From e271c316e90aa7f41dbd989c8395e9b4e8d09157 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Dec 2022 08:14:21 +0000 Subject: [PATCH 1/5] chore(deps-dev): update rector/rector requirement from 0.14.8 to 0.15.0 Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](https://github.com/rectorphp/rector/compare/0.14.8...0.15.0) --- updated-dependencies: - dependency-name: rector/rector dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index eba5669..e7c4e8c 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "require-dev": { "codeigniter4/framework": "^4.1", "icanhazstring/composer-unused": "^0.8.2", - "rector/rector": "0.14.8" + "rector/rector": "0.15.0" }, "minimum-stability": "dev", "prefer-stable": true, From 8253b868b8c5b03a4dde0a038e177878cf36fe75 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 5 Dec 2022 16:40:39 +0700 Subject: [PATCH 2/5] update deprecated TypedPropertyRector to TypedPropertyFromAssignsRector --- .github/workflows/rector.yml | 2 +- rector.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 11677a6..3aef723 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -62,5 +62,5 @@ jobs: - name: Analyze for refactoring run: | - composer global require --dev rector/rector:^0.13.8 + composer global require --dev rector/rector:^0.15.0 rector process --dry-run --no-progress-bar diff --git a/rector.php b/rector.php index 448606c..2e1bbba 100644 --- a/rector.php +++ b/rector.php @@ -1,5 +1,6 @@ rule(SimplifyEmptyArrayCheckRector::class); $rectorConfig->rule(NormalizeNamespaceByPSR4ComposerAutoloadRector::class); $rectorConfig - ->ruleWithConfiguration(TypedPropertyRector::class, [ + ->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [ // Set to false if you use in libraries, or it does create breaking changes. - TypedPropertyRector::INLINE_PUBLIC => true, + TypedPropertyFromAssignsRector::INLINE_PUBLIC => false, ]); }; From 2ed9e267c77402ded1b354e267fd76449ba52a09 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 5 Dec 2022 16:42:04 +0700 Subject: [PATCH 3/5] set INLINE_PUBLIC to true as previous config --- rector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rector.php b/rector.php index 2e1bbba..cd16211 100644 --- a/rector.php +++ b/rector.php @@ -114,6 +114,6 @@ $rectorConfig ->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [ // Set to false if you use in libraries, or it does create breaking changes. - TypedPropertyFromAssignsRector::INLINE_PUBLIC => false, + TypedPropertyFromAssignsRector::INLINE_PUBLIC => true, ]); }; From cf4df09b06fca93d89b1dfbe93b66ec4deef620a Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 5 Dec 2022 16:43:47 +0700 Subject: [PATCH 4/5] Fix config rector in template --- src/Template/rector.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Template/rector.php b/src/Template/rector.php index f6c6018..86c801a 100644 --- a/src/Template/rector.php +++ b/src/Template/rector.php @@ -17,6 +17,7 @@ use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector; use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector; use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; +use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; use Rector\Config\RectorConfig; use Rector\Core\ValueObject\PhpVersion; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector; @@ -29,7 +30,6 @@ use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector; use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector; -use Rector\Php74\Rector\Property\TypedPropertyRector; use Rector\PHPUnit\Set\PHPUnitLevelSetList; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector; @@ -114,8 +114,8 @@ $rectorConfig->rule(SimplifyEmptyArrayCheckRector::class); $rectorConfig->rule(NormalizeNamespaceByPSR4ComposerAutoloadRector::class); $rectorConfig - ->ruleWithConfiguration(TypedPropertyRector::class, [ + ->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [ // Set to false if you use in libraries, or it does create breaking changes. - TypedPropertyRector::INLINE_PUBLIC => true, + TypedPropertyFromAssignsRector::INLINE_PUBLIC => true, ]); }; From 1358f64b369cac519e6da61e1d35be53e86c4fd3 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 5 Dec 2022 16:44:54 +0700 Subject: [PATCH 5/5] Fix rector config deprecated TypedPropertyRector --- rector.php | 4 ++-- src/Template/rector.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rector.php b/rector.php index cd16211..19e4b3a 100644 --- a/rector.php +++ b/rector.php @@ -1,7 +1,5 @@ sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitSetList::PHPUNIT_80]); diff --git a/src/Template/rector.php b/src/Template/rector.php index 86c801a..e11a68b 100644 --- a/src/Template/rector.php +++ b/src/Template/rector.php @@ -17,7 +17,6 @@ use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector; use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector; use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; -use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; use Rector\Config\RectorConfig; use Rector\Core\ValueObject\PhpVersion; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector; @@ -35,6 +34,7 @@ use Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; +use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; return static function (RectorConfig $rectorConfig): void { $rectorConfig->sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitLevelSetList::UP_TO_PHPUNIT_100]);