From 49c3f5210693b2a92e1bc0a073a075075fd11e26 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 27 May 2024 18:36:30 +0400 Subject: [PATCH] chore: fix psalm issues --- psalm-baseline.xml | 20 ------------------- .../Declaration/Dispatcher/Dispatcher.php | 8 ++------ src/Internal/Marshaller/Type/ArrayType.php | 1 + 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 045712fb..e6ccb4cd 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -509,9 +509,6 @@ - - getInstance($prototype)]]> - @@ -527,12 +524,6 @@ - - getInstance($prototype)]]> - - - - @@ -595,12 +586,10 @@ - - @@ -615,7 +604,6 @@ - @@ -752,13 +740,9 @@ - - - - @@ -1144,10 +1128,6 @@ - - - - diff --git a/src/Internal/Declaration/Dispatcher/Dispatcher.php b/src/Internal/Declaration/Dispatcher/Dispatcher.php index 353049c7..2db1af61 100644 --- a/src/Internal/Declaration/Dispatcher/Dispatcher.php +++ b/src/Internal/Declaration/Dispatcher/Dispatcher.php @@ -131,15 +131,11 @@ private function createExecutorFromMethod(\ReflectionMethod $fun): \Closure * @psalm-return FunctionExecutor * * @param \ReflectionFunction $fun - * @return \Closure + * @return \Closure(object, array): mixed */ private function createExecutorFromFunction(\ReflectionFunction $fun): \Closure { - return static function (?object $ctx, array $arguments) use ($fun) { - if ($ctx === null) { - return $fun->invoke(...$arguments); - } - + return static function (object $ctx, array $arguments) use ($fun) { $closure = $fun->getClosure(); try { diff --git a/src/Internal/Marshaller/Type/ArrayType.php b/src/Internal/Marshaller/Type/ArrayType.php index 6128451a..271331a4 100644 --- a/src/Internal/Marshaller/Type/ArrayType.php +++ b/src/Internal/Marshaller/Type/ArrayType.php @@ -70,6 +70,7 @@ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule /** * @psalm-assert array $value + * @param mixed $value * @param array $current */ public function parse($value, $current): array