From 1b6fd564d45d0007bcfbf8ae818aff5560389fe7 Mon Sep 17 00:00:00 2001 From: Sam Mousa Date: Tue, 10 Sep 2024 11:17:01 +0200 Subject: [PATCH] fix: relax callable typehints to not require pure --- src/MapperBuilder.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/MapperBuilder.php b/src/MapperBuilder.php index 48ffecc2..21dbfd8b 100644 --- a/src/MapperBuilder.php +++ b/src/MapperBuilder.php @@ -57,7 +57,7 @@ public function __construct() * ``` * * @param interface-string|class-string $name - * @psalm-param pure-callable $callback + * @param callable $callback */ public function infer(string $name, callable $callback): self { @@ -200,7 +200,6 @@ public function infer(string $name, callable $callback): self * ]); * ``` * - * @psalm-param pure-callable|class-string ...$constructors * @param callable|class-string ...$constructors */ public function registerConstructor(callable|string ...$constructors): self @@ -298,7 +297,6 @@ public function withCache(CacheInterface $cache): self /** * @template T - * @psalm-param pure-callable(T): T $callback * @param callable(T): T $callback */ public function alter(callable $callback): self @@ -446,7 +444,6 @@ public function allowPermissiveTypes(): self * ]); * ``` * - * @psalm-param pure-callable(Throwable): ErrorMessage $filter * @param callable(Throwable): ErrorMessage $filter */ public function filterExceptions(callable $filter): self @@ -514,7 +511,6 @@ public function filterExceptions(callable $filter): self * ->normalize('Hello world'); // HELLO WORLD?! * ``` * - * @psalm-param pure-callable|class-string $transformer * @param callable|class-string $transformer */ public function registerTransformer(callable|string $transformer, int $priority = 0): self