diff --git a/Makefile b/Makefile index 58341ca..d224b7f 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ DEV_DEPENDENCIES = cakephp/cakephp:5.x-dev \ cakephp/cakephp-codesniffer:^5.0 \ mikey179/vfsstream:^1.6.8 \ - phpunit/phpunit:^10.1 + phpunit/phpunit:^10.5.38 install-dev: composer require --dev $(DEV_DEPENDENCIES) diff --git a/composer.json b/composer.json index ff67259..5b749aa 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "php": "^8.1", "cakephp/console": "^5.0", "nette/utils": "^4.0", - "rector/rector": "~1.2.0", + "rector/rector": "~2.0.0", "symfony/string": "^6.0 || ^7.0" }, "autoload": { diff --git a/src/Rector/Rector/MethodCall/ArrayToFluentCallRector.php b/src/Rector/Rector/MethodCall/ArrayToFluentCallRector.php index 6f69669..ee41b65 100644 --- a/src/Rector/Rector/MethodCall/ArrayToFluentCallRector.php +++ b/src/Rector/Rector/MethodCall/ArrayToFluentCallRector.php @@ -181,7 +181,7 @@ private function replaceArrayToFluentMethodCalls( } /** - * @param array<(\PhpParser\Node\Expr\ArrayItem|null)> $originalArrayItems + * @param array<(\PhpParser\Node\ArrayItem | null)> $originalArrayItems * @param array $arrayMap */ private function extractFluentMethods(array $originalArrayItems, array $arrayMap): ArrayItemsAndFluentClass diff --git a/src/Rector/Rector/Namespace_/AppUsesStaticCallToUseStatementRector.php b/src/Rector/Rector/Namespace_/AppUsesStaticCallToUseStatementRector.php index 14df897..9aa3818 100644 --- a/src/Rector/Rector/Namespace_/AppUsesStaticCallToUseStatementRector.php +++ b/src/Rector/Rector/Namespace_/AppUsesStaticCallToUseStatementRector.php @@ -11,7 +11,7 @@ use PhpParser\Node\Stmt\Declare_; use PhpParser\Node\Stmt\Namespace_; use PhpParser\Node\Stmt\Use_; -use PhpParser\Node\Stmt\UseUse; +use PhpParser\Node\UseItem; use PhpParser\NodeTraverser; use PHPStan\Type\ObjectType; use Rector\Contract\PhpParser\Node\StmtsAwareInterface; @@ -82,7 +82,7 @@ public function refactor(Node $node): ?Node $names = $this->resolveNamesFromStaticCalls($appUsesStaticCalls); $uses = []; foreach ($names as $name) { - $useUse = new UseUse(new Name($name)); + $useUse = new UseItem(new Name($name)); $uses[] = new Use_([$useUse]); } diff --git a/src/Rector/Rector/Property/ChangeSnakedFixtureNameToPascalRector.php b/src/Rector/Rector/Property/ChangeSnakedFixtureNameToPascalRector.php index b162e54..a1c7904 100644 --- a/src/Rector/Rector/Property/ChangeSnakedFixtureNameToPascalRector.php +++ b/src/Rector/Rector/Property/ChangeSnakedFixtureNameToPascalRector.php @@ -5,11 +5,11 @@ use Cake\Utility\Inflector; use PhpParser\Node; +use PhpParser\Node\ArrayItem; use PhpParser\Node\Expr\Array_; -use PhpParser\Node\Expr\ArrayItem; +use PhpParser\Node\PropertyItem; use PhpParser\Node\Scalar\String_; use PhpParser\Node\Stmt\Property; -use PhpParser\Node\Stmt\PropertyProperty; use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -76,7 +76,7 @@ public function refactor(Node $node): ?Node return $node; } - private function refactorPropertyWithArrayDefault(PropertyProperty $propertyProperty): void + private function refactorPropertyWithArrayDefault(PropertyItem $propertyProperty): void { if (! $propertyProperty->default instanceof Array_) { return; diff --git a/src/Rector/ValueObject/ArrayItemsAndFluentClass.php b/src/Rector/ValueObject/ArrayItemsAndFluentClass.php index 73400fe..1abdece 100644 --- a/src/Rector/ValueObject/ArrayItemsAndFluentClass.php +++ b/src/Rector/ValueObject/ArrayItemsAndFluentClass.php @@ -6,7 +6,7 @@ final class ArrayItemsAndFluentClass { /** - * @param array<\PhpParser\Node\Expr\ArrayItem> $arrayItems + * @param array<\PhpParser\Node\ArrayItem> $arrayItems * @param array $fluentCalls */ public function __construct( @@ -16,7 +16,7 @@ public function __construct( } /** - * @return array<\PhpParser\Node\Expr\ArrayItem> + * @return array<\PhpParser\Node\ArrayItem> */ public function getArrayItems(): array { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3e5dfa9..a600612 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -11,6 +11,8 @@ error_reporting(-1); date_default_timezone_set('UTC'); +require dirname(__DIR__) . '/vendor/rector/rector/preload.php'; + require dirname(__DIR__) . '/vendor/autoload.php'; require dirname(__DIR__) . '/config/bootstrap.php';