Skip to content

Commit

Permalink
Merge pull request #426 from saloonphp/fix/phpstan
Browse files Browse the repository at this point in the history
Fix | PHPStan v1.11
  • Loading branch information
Sammyjo20 authored Jun 9, 2024
2 parents 25cecb8 + d31acdf commit 34f9d5d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 61 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
55 changes: 5 additions & 50 deletions phpstan.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
16 changes: 6 additions & 10 deletions src/Traits/Conditionable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 34f9d5d

Please sign in to comment.