diff --git a/Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php b/Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php index a09fd34a..d7c38345 100644 --- a/Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php +++ b/Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php @@ -9,7 +9,7 @@ use PhpParser\Node; use PhpParser\Node\Stmt\Class_; -use Rector\Core\Rector\AbstractRector; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/Magento2/Rector/Src/ReplaceMbStrposNullLimit.php b/Magento2/Rector/Src/ReplaceMbStrposNullLimit.php index 06ffaf25..06f04629 100644 --- a/Magento2/Rector/Src/ReplaceMbStrposNullLimit.php +++ b/Magento2/Rector/Src/ReplaceMbStrposNullLimit.php @@ -10,7 +10,7 @@ use PhpParser\Node; use PhpParser\Node\Expr\FuncCall; use PhpParser\Node\Scalar\LNumber; -use Rector\Core\Rector\AbstractRector; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/Magento2/Rector/Src/ReplaceNewDateTimeNull.php b/Magento2/Rector/Src/ReplaceNewDateTimeNull.php index 1bf54f0a..0ddabe51 100644 --- a/Magento2/Rector/Src/ReplaceNewDateTimeNull.php +++ b/Magento2/Rector/Src/ReplaceNewDateTimeNull.php @@ -10,7 +10,7 @@ use PhpParser\Node; use PhpParser\Node\Expr\New_; use PhpParser\Node\Scalar\String_; -use Rector\Core\Rector\AbstractRector; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/Magento2/Rector/Src/ReplacePregSplitNullLimit.php b/Magento2/Rector/Src/ReplacePregSplitNullLimit.php index cc918eb4..b3f1d318 100644 --- a/Magento2/Rector/Src/ReplacePregSplitNullLimit.php +++ b/Magento2/Rector/Src/ReplacePregSplitNullLimit.php @@ -10,7 +10,7 @@ use PhpParser\Node; use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Expr\FuncCall; -use Rector\Core\Rector\AbstractRector; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/composer.json b/composer.json index 67899921..b37ca83b 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "33", + "version": "34", "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2 || ^1.0", @@ -14,7 +14,7 @@ "ext-simplexml": "*", "ext-dom": "*", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.17.12", + "rector/rector": "^1.2.4", "phpcsstandards/phpcsutils": "^1.0.5", "magento/php-compatibility-fork": "^0.1" }, diff --git a/composer.lock b/composer.lock index 334ccb71..d1497e33 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eb76f91be26c872c1f30436de62676aa", + "content-hash": "75815481661a1c5a6ede736bc0f2a855", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -243,16 +243,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.50", + "version": "1.12.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4" + "reference": "0ca1c7bb55fca8fe6448f16fff0f311ccec960a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/06a98513ac72c03e8366b5a0cb00750b487032e4", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0ca1c7bb55fca8fe6448f16fff0f311ccec960a1", + "reference": "0ca1c7bb55fca8fe6448f16fff0f311ccec960a1", "shasum": "" }, "require": { @@ -295,31 +295,27 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2023-12-13T10:59:42+00:00" + "time": "2024-09-05T16:09:28+00:00" }, { "name": "rector/rector", - "version": "0.17.13", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "e2003ba7c5bda06d7bb419cf4be8dae5f8672132" + "reference": "42a4aa23b48b4cfc8ebfeac2b570364e27744381" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/e2003ba7c5bda06d7bb419cf4be8dae5f8672132", - "reference": "e2003ba7c5bda06d7bb419cf4be8dae5f8672132", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/42a4aa23b48b4cfc8ebfeac2b570364e27744381", + "reference": "42a4aa23b48b4cfc8ebfeac2b570364e27744381", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.26" + "phpstan/phpstan": "^1.11.11" }, "conflict": { "rector/rector-doctrine": "*", @@ -327,6 +323,9 @@ "rector/rector-phpunit": "*", "rector/rector-symfony": "*" }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, "bin": [ "bin/rector" ], @@ -349,7 +348,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.17.13" + "source": "https://github.com/rectorphp/rector/tree/1.2.4" }, "funding": [ { @@ -357,7 +356,7 @@ "type": "github" } ], - "time": "2023-08-14T16:33:29+00:00" + "time": "2024-08-23T09:03:01+00:00" }, { "name": "squizlabs/php_codesniffer", diff --git a/rector.php b/rector.php index 8bc53e56..bd9da885 100644 --- a/rector.php +++ b/rector.php @@ -5,7 +5,7 @@ use Magento2\Rector\Src\ReplaceMbStrposNullLimit; use Magento2\Rector\Src\ReplaceNewDateTimeNull; use Rector\Config\RectorConfig; -use Rector\Core\ValueObject\PhpVersion; +use Rector\ValueObject\PhpVersion; use Rector\Php80\Rector\Class_\StringableForToStringRector; use Rector\Php80\Rector\ClassMethod\FinalPrivateToPrivateVisibilityRector; use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector; @@ -17,16 +17,13 @@ $rectorConfig->phpVersion(PhpVersion::PHP_80); $rectorConfig->phpVersion(PhpVersion::PHP_81); - // get services (needed for register a single rule) - $services = $rectorConfig->services(); - // register a single rule - $services->set(FinalPrivateToPrivateVisibilityRector::class); - $services->set(OptionalParametersAfterRequiredRector::class); - $services->set(SetStateToStaticRector::class); - $services->set(StringableForToStringRector::class); - $services->set(Php81ResourceReturnToObjectRector::class); - $services->set(ReplacePregSplitNullLimit::class); - $services->set(ReplaceMbStrposNullLimit::class); - $services->set(ReplaceNewDateTimeNull::class); + $rectorConfig->singleton(FinalPrivateToPrivateVisibilityRector::class); + $rectorConfig->singleton(OptionalParametersAfterRequiredRector::class); + $rectorConfig->singleton(SetStateToStaticRector::class); + $rectorConfig->singleton(StringableForToStringRector::class); + $rectorConfig->singleton(Php81ResourceReturnToObjectRector::class); + $rectorConfig->singleton(ReplacePregSplitNullLimit::class); + $rectorConfig->singleton(ReplaceMbStrposNullLimit::class); + $rectorConfig->singleton(ReplaceNewDateTimeNull::class); };