Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/target-repository/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"require": {
"php": "^7.4|^8.0",
"phpstan/phpstan": "^2.2.12"
"phpstan/phpstan": "^2.2.14"
},
"autoload": {
"files": [
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"entropy/entropy": "^0.4.12",
"fidry/cpu-core-counter": "^1.1",
"nette/utils": "^4.1.4",
"nikic/php-parser": "^5.8",
"nikic/php-parser": "^5.9",
"ondram/ci-detector": "^4.2",
"phpstan/phpdoc-parser": "^2.3.3",
"phpstan/phpstan": "^2.2.12",
"phpstan/phpstan": "^2.2.14",
"react/child-process": "^0.6.5",
"react/event-loop": "^1.6",
"react/socket": "^1.17",
Expand Down
1 change: 1 addition & 0 deletions preload-split-package.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function isPHPStanTestPreloaded(): bool
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Modifiers.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/NameContext.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node/ArgPlaceholder.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php';
Expand Down
1 change: 1 addition & 0 deletions preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function isPHPStanTestPreloaded(): bool
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Modifiers.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NameContext.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node/ArgPlaceholder.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php';
Expand Down
3 changes: 2 additions & 1 deletion rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\ArgPlaceholder;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Stmt\ClassMethod;
Expand Down Expand Up @@ -158,7 +159,7 @@ private function removeByName(ClassMethod|StaticCall|MethodCall $node, int $posi
/**
* @param mixed[] $values
*/
private function isArgumentValueMatch(Arg|VariadicPlaceholder $arg, array $values): bool
private function isArgumentValueMatch(Arg|ArgPlaceholder|VariadicPlaceholder $arg, array $values): bool
{
if (! $arg instanceof Arg) {
return false;
Expand Down
5 changes: 3 additions & 2 deletions rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\TypeDeclaration\NodeAnalyzer;

use PhpParser\Node\Arg;
use PhpParser\Node\ArgPlaceholder;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\MethodCall;
Expand Down Expand Up @@ -207,9 +208,9 @@ private function normalizeType(Type $argValueType): MixedType|ObjectType|Type
* There is first class callable usage, or argument unpack, or named expr
* simply returns array marks as unknown as can be anything and in any position
*/
private function shouldSkipArg(Arg|VariadicPlaceholder $arg): bool
private function shouldSkipArg(Arg|ArgPlaceholder|VariadicPlaceholder $arg): bool
{
if ($arg instanceof VariadicPlaceholder) {
if (! $arg instanceof Arg) {
return true;
}

Expand Down
7 changes: 4 additions & 3 deletions src/NodeAnalyzer/CompactFuncCallAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\NodeAnalyzer;

use PhpParser\Node\Arg;
use PhpParser\Node\ArgPlaceholder;
use PhpParser\Node\ArrayItem;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\FuncCall;
Expand Down Expand Up @@ -34,7 +35,7 @@ public function isInCompact(FuncCall $funcCall, Variable $variable): bool
}

/**
* @param array<int, Arg|VariadicPlaceholder|ArrayItem|null> $nodes
* @param array<int, Arg|ArgPlaceholder|VariadicPlaceholder|ArrayItem|null> $nodes
*/
private function isInArgOrArrayItemNodes(array $nodes, string $variableName): bool
{
Expand Down Expand Up @@ -64,12 +65,12 @@ private function isInArgOrArrayItemNodes(array $nodes, string $variableName): bo
return false;
}

private function shouldSkip(Arg|VariadicPlaceholder|ArrayItem|null $node): bool
private function shouldSkip(Arg|ArgPlaceholder|VariadicPlaceholder|ArrayItem|null $node): bool
{
if ($node === null) {
return true;
}

return $node instanceof VariadicPlaceholder;
return ! $node instanceof Arg && ! $node instanceof ArrayItem;
}
}
Loading