From 5d731e63f9fc56c127b9f0f87049b2b52a53d687 Mon Sep 17 00:00:00 2001 From: lubiana Date: Fri, 1 Sep 2023 07:52:22 +0200 Subject: [PATCH] update rector rules. bump versions --- composer.json | 13 ++++++-- composer.lock | 77 +++++++++++++++++++++++------------------------ config/rector.php | 8 ++--- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/composer.json b/composer.json index 8cb1c41..a241af0 100644 --- a/composer.json +++ b/composer.json @@ -8,13 +8,20 @@ } }, "require": { - "slevomat/coding-standard": "^8.12.1", - "symplify/easy-coding-standard": "^11.3.4", - "rector/rector": "^0.16.0" + "slevomat/coding-standard": "^8.13", + "symplify/easy-coding-standard": "^12.0", + "rector/rector": "^0.18.1" }, "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true } + }, + "scripts": { + "fix": [ + "rector", + "ecs --fix", + "ecs --fix" + ] } } diff --git a/composer.lock b/composer.lock index 8cf1292..a6c3597 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": "f25cb69dd8eb380eb2a8fdc886671eb1", + "content-hash": "0db36479542579fe3ed4d0a242e19390", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -86,22 +86,24 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.20.4", + "version": "1.23.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd" + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", - "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26", + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.5", @@ -125,22 +127,22 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.4" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1" }, - "time": "2023-05-02T09:19:37+00:00" + "time": "2023-08-03T16:32:59+00:00" }, { "name": "phpstan/phpstan", - "version": "1.10.15", + "version": "1.10.32", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd" + "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/762c4dac4da6f8756eebb80e528c3a47855da9bd", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c47e47d3ab03137c0e121e77c4d2cb58672f6d44", + "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44", "shasum": "" }, "require": { @@ -189,25 +191,25 @@ "type": "tidelift" } ], - "time": "2023-05-09T15:28:01+00:00" + "time": "2023-08-24T21:54:50+00:00" }, { "name": "rector/rector", - "version": "0.16.0", + "version": "0.18.1", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f" + "reference": "ee72ef542680a7f47ed8c6784f78b032c0d2f381" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/2125ff71ea05b079562a8f59ca48a97eb78dc07f", - "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/ee72ef542680a7f47ed8c6784f78b032c0d2f381", + "reference": "ee72ef542680a7f47ed8c6784f78b032c0d2f381", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.14" + "phpstan/phpstan": "^1.10.31" }, "conflict": { "rector/rector-doctrine": "*", @@ -219,11 +221,6 @@ "bin/rector" ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.15-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -242,7 +239,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.16.0" + "source": "https://github.com/rectorphp/rector/tree/0.18.1" }, "funding": [ { @@ -250,36 +247,36 @@ "type": "github" } ], - "time": "2023-05-05T12:12:17+00:00" + "time": "2023-08-28T18:01:58+00:00" }, { "name": "slevomat/coding-standard", - "version": "8.12.1", + "version": "8.13.4", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "f69e2524e8770efb9b3e5ac4a0ebc0d54eb446d7" + "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/f69e2524e8770efb9b3e5ac4a0ebc0d54eb446d7", - "reference": "f69e2524e8770efb9b3e5ac4a0ebc0d54eb446d7", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/4b2af2fb17773656d02fbfb5d18024ebd19fe322", + "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": ">=1.20.0 <1.21.0", + "phpstan/phpdoc-parser": "^1.23.0", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.15", + "phpstan/phpstan": "1.10.26", "phpstan/phpstan-deprecation-rules": "1.1.3", - "phpstan/phpstan-phpunit": "1.3.11", + "phpstan/phpstan-phpunit": "1.3.13", "phpstan/phpstan-strict-rules": "1.5.1", - "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.1.3" + "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.2.6" }, "type": "phpcodesniffer-standard", "extra": { @@ -303,7 +300,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.12.1" + "source": "https://github.com/slevomat/coding-standard/tree/8.13.4" }, "funding": [ { @@ -315,7 +312,7 @@ "type": "tidelift" } ], - "time": "2023-05-15T21:42:25+00:00" + "time": "2023-07-25T10:28:55+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -376,16 +373,16 @@ }, { "name": "symplify/easy-coding-standard", - "version": "11.3.4", + "version": "12.0.7", "source": { "type": "git", "url": "https://github.com/easy-coding-standard/easy-coding-standard.git", - "reference": "c72eb4bdf30e54de2d31aef596f96642ff443741" + "reference": "79b5679f0dd758311770543969087b8dc46429ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/c72eb4bdf30e54de2d31aef596f96642ff443741", - "reference": "c72eb4bdf30e54de2d31aef596f96642ff443741", + "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/79b5679f0dd758311770543969087b8dc46429ee", + "reference": "79b5679f0dd758311770543969087b8dc46429ee", "shasum": "" }, "require": { @@ -418,7 +415,7 @@ ], "support": { "issues": "https://github.com/easy-coding-standard/easy-coding-standard/issues", - "source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/11.3.4" + "source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.0.7" }, "funding": [ { @@ -430,7 +427,7 @@ "type": "github" } ], - "time": "2023-05-10T14:44:08+00:00" + "time": "2023-08-24T21:43:33+00:00" } ], "packages-dev": [], diff --git a/config/rector.php b/config/rector.php index 5713df5..1cf8f58 100644 --- a/config/rector.php +++ b/config/rector.php @@ -20,9 +20,8 @@ use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRect use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector; use Rector\EarlyReturn\Rector\If_\ChangeNestedIfsToEarlyReturnRector; use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector; -use Rector\EarlyReturn\Rector\If_\ChangeOrIfReturnToEarlyReturnRector; +use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector; use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector; -use Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector; use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector; use Rector\EarlyReturn\Rector\StmtsAwareInterface\ReturnEarlyIfVariableRector; use Rector\Php80\Rector\ClassConstFetch\ClassOnThisVariableObjectRector; @@ -41,7 +40,6 @@ use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRect use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNewArrayRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector; -use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector; use Rector\TypeDeclaration\Rector\FunctionLike\AddParamTypeSplFixedArrayRector; use Rector\TypeDeclaration\Rector\FunctionLike\AddReturnTypeDeclarationFromYieldsRector; use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector; @@ -52,7 +50,6 @@ return static function (RectorConfig $c): void { $c->sets([LevelSetList::UP_TO_PHP_82]); $c->rules([ AddArrowFunctionReturnTypeRector::class, - AddClosureReturnTypeRector::class, AddMethodCallBasedStrictParamTypeRector::class, AddParamTypeFromPropertyTypeRector::class, AddParamTypeSplFixedArrayRector::class, @@ -63,7 +60,6 @@ return static function (RectorConfig $c): void { ChangeNestedForeachIfsToEarlyContinueRector::class, ChangeNestedIfsToEarlyReturnRector::class, ChangeOrIfContinueToMultiContinueRector::class, - ChangeOrIfReturnToEarlyReturnRector::class, ClassOnThisVariableObjectRector::class, CountArrayToEmptyArrayComparisonRector::class, ExplicitBoolCompareRector::class, @@ -77,7 +73,6 @@ return static function (RectorConfig $c): void { ParamTypeFromStrictTypedPropertyRector::class, PreparedValueToEarlyReturnRector::class, ReplaceMultipleBooleanNotRector::class, - ReturnBinaryAndToEarlyReturnRector::class, ReturnBinaryOrToEarlyReturnRector::class, ReturnEarlyIfVariableRector::class, ReturnTypeFromReturnDirectArrayRector::class, @@ -96,5 +91,6 @@ return static function (RectorConfig $c): void { ThrowWithPreviousExceptionRector::class, TypedPropertyFromStrictConstructorRector::class, TypedPropertyFromStrictGetterMethodReturnTypeRector::class, + RemoveAlwaysElseRector::class, ]); };