diff --git a/composer.json b/composer.json index dff07bc8..78cc91f2 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "illuminate/collections": "^9.39 || ^10.0", "league/flysystem": "^3.0", "pestphp/pest": "^2.6", - "phpstan/phpstan": "^1.9", + "phpstan/phpstan": "^1.11.4", "saloonphp/xml-wrangler": "^1.1", "spatie/ray": "^1.33", "symfony/dom-crawler": "^6.0 || ^7.0", diff --git a/phpstan.baseline.neon b/phpstan.baseline.neon index 106d14e2..23ea18cc 100644 --- a/phpstan.baseline.neon +++ b/phpstan.baseline.neon @@ -20,51 +20,6 @@ parameters: count: 1 path: src/Http/Faking/MockClient.php - - - message: "#^Parameter \\#2 \\$ of callable callable\\(\\$this, TValue\\)\\: void expects TValue\\, array\\|float\\|int\\|string\\|false\\|null given.$#" - count: 2 - path: src/Http/Connector.php - - - - message: "#^Parameter \\#2 \\$ of callable callable\\(\\$this, TValue\\)\\: void expects TValue\\, array\\|float\\|int\\|string\\|false\\|null given.$#" - count: 2 - path: src/Http/PendingRequest.php - - - - message: "#^Parameter \\#2 \\$ of callable callable\\(\\$this, TValue\\)\\: void expects TValue\\, array\\|float\\|int\\|string\\|false\\|null given.$#" - count: 2 - path: src/Http/Request.php - - - - message: "#^Parameter \\#2 \\$ of callable callable\\(\\$this, TValue\\)\\: void expects TValue\\, array\\|float\\|int\\|string\\|false\\|null given.$#" - count: 2 - path: src/Repositories/ArrayStore.php - - - - message: "#^Parameter \\#2 \\$ of callable callable\\(\\$this, TValue\\)\\: void expects TValue\\, array\\|float\\|int\\|string\\|false\\|null given.$#" - count: 2 - path: src/Repositories/IntegerStore.php - - - - message: "#^Parameter \\#2 \\$ of callable callable\\(\\$this, TValue\\)\\: void expects TValue\\, array\\|float\\|int\\|string\\|false\\|null given.$#" - count: 2 - path: src/Repositories/Body/ArrayBodyRepository.php - - - - message: "#^Parameter \\#2 \\$ of callable callable\\(\\$this, TValue\\)\\: void expects TValue\\, array\\|float\\|int\\|string\\|false\\|null given.$#" - count: 2 - path: src/Repositories/Body/MultipartBodyRepository.php - - - - message: "#^Parameter \\#2 \\$ of callable callable\\(\\$this, TValue\\)\\: void expects TValue\\, array\\|float\\|int\\|string\\|false\\|null given.$#" - count: 2 - path: src/Repositories/Body/StringBodyRepository.php - - - - message: "#^Parameter \\#2 \\$ of callable callable\\(\\$this, TValue\\)\\: void expects TValue\\, array\\|float\\|int\\|string\\|false\\|null given.$#" - count: 2 - path: src/Repositories/Body/StreamBodyRepository.php - - message: "#^Result of \\&\\& is always false.$#" count: 1 @@ -85,11 +40,6 @@ parameters: count: 1 path: src/Http/Faking/MockClient.php - - - message: "#^Match arm is unreachable because previous comparison is always true.$#" - count: 1 - path: src/Http/Pool.php - - message: "#^Parameter \\#1 \\$object of method ReflectionMethod\\:\\:invoke\\(\\) expects object\\|null, class-string\\|object given.$#" count: 2 @@ -99,3 +49,8 @@ parameters: message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, \\(callable\\(\\)\\: mixed\\)\\|object given.$#" count: 4 path: src/Traits/Macroable.php + + - + message: "#^Match arm is unreachable because previous comparison is always true.$#" + count: 1 + path: src/Http/Pool.php diff --git a/src/Traits/Conditionable.php b/src/Traits/Conditionable.php index c8172ed9..aa85a81b 100644 --- a/src/Traits/Conditionable.php +++ b/src/Traits/Conditionable.php @@ -11,11 +11,9 @@ trait Conditionable /** * Invoke a callable where a given value returns a truthy value. * - * @template TValue - * - * @param \Closure(): (TValue)|TValue $value - * @param callable($this, TValue): (void) $callback - * @param callable($this, TValue): (void)|null $default + * @param \Closure(): (mixed)|mixed $value + * @param callable($this, mixed): (void) $callback + * @param callable($this, mixed): (void)|null $default * @return $this */ public function when(mixed $value, callable $callback, callable|null $default = null): static @@ -38,11 +36,9 @@ public function when(mixed $value, callable $callback, callable|null $default = /** * Invoke a callable when a given value returns a falsy value. * - * @template TValue - * - * @param \Closure(): (TValue)|TValue $value - * @param callable($this, TValue): (void) $callback - * @param callable($this, TValue): (void)|null $default + * @param \Closure(): (mixed)|mixed $value + * @param callable($this, mixed): (void) $callback + * @param callable($this, mixed): (void)|null $default * @return $this */ public function unless(mixed $value, callable $callback, callable|null $default = null): static