From 0488f2914ae4b0668f7ac2ee99b7ece20cb065fc Mon Sep 17 00:00:00 2001 From: MGatner Date: Sat, 27 Aug 2022 19:44:36 +0000 Subject: [PATCH 01/25] Fix logic issue --- src/Template/psalm_autoload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Template/psalm_autoload.php b/src/Template/psalm_autoload.php index 2a9c211..30e9fbf 100644 --- a/src/Template/psalm_autoload.php +++ b/src/Template/psalm_autoload.php @@ -10,11 +10,11 @@ ]; foreach ($helperDirs as $dir) { + $dir = __DIR__ . '/' . $dir; if (! is_dir($dir)) { continue; } - $dir = __DIR__ . '/' . $dir; chdir($dir); foreach (glob('*_helper.php') as $filename) { From 31c13415a6ceb1ea7ad69d0b820ae6a97353a4fa Mon Sep 17 00:00:00 2001 From: MGatner Date: Sat, 27 Aug 2022 19:58:42 +0000 Subject: [PATCH 02/25] Update Rector for PHPUnit level set list --- src/Template/rector.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Template/rector.php b/src/Template/rector.php index 5d05999..f6c6018 100644 --- a/src/Template/rector.php +++ b/src/Template/rector.php @@ -30,13 +30,14 @@ 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; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitSetList::PHPUNIT_80]); + $rectorConfig->sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitLevelSetList::UP_TO_PHPUNIT_100]); $rectorConfig->parallel(); // The paths to refactor (can also be supplied with CLI arguments) $rectorConfig->paths([ From 0382c0bd9caf6c5c680d53837951a702debcff4f Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 1 Sep 2022 10:58:32 +0900 Subject: [PATCH 03/25] chore: update composer scripts --- composer.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 87c03c6..c0eff91 100644 --- a/composer.json +++ b/composer.json @@ -58,15 +58,16 @@ "Composer\\Config::disableProcessTimeout", "@cs", "@deduplicate", - "@inspect", "@analyze", + "@inspect", "@test" ], "cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff", - "cs-fix": "php-cs-fixer fix --ansi --verbose --diff --using-cache=yes", + "cs-fix": "php-cs-fixer fix --ansi --verbose --diff", "style": "@cs-fix", "deduplicate": "phpcpd app/ src/", "inspect": "deptrac analyze --cache-file=build/deptrac.cache", - "mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit" + "mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit", + "test": "phpunit" } } From 600a725fe8d4975e9aa36aabb27cc565112c33be Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 2 Sep 2022 07:54:04 +0900 Subject: [PATCH 04/25] chore: move @inspect before @analyze --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c0eff91..e16eff1 100644 --- a/composer.json +++ b/composer.json @@ -58,8 +58,8 @@ "Composer\\Config::disableProcessTimeout", "@cs", "@deduplicate", - "@analyze", "@inspect", + "@analyze", "@test" ], "cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff", From 23134478dab9dfe158afb4c0b785e76cdab41d76 Mon Sep 17 00:00:00 2001 From: MGatner Date: Wed, 7 Sep 2022 12:53:55 +0000 Subject: [PATCH 05/25] Indicate library as suitable for require-dev --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e16eff1..70c389f 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ "devkit", "toolkit", "development", - "tools" + "tools", + "static analysis" ], "authors": [ { From 84c94c590a85917c371e938357ac71ba92eae53a Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 9 Sep 2022 15:29:15 +0900 Subject: [PATCH 06/25] docs: add CONTRIBUTING.md --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b712dd6 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# Contributing to CodeIgniter4 + +CodeIgniter is a community driven project and accepts contributions of +code and documentation from the community. + +If you'd like to contribute, please read [Contributing to CodeIgniter](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/README.md) +in the [main repository](https://github.com/codeigniter4/CodeIgniter4). + +If you are going to contribute to this repository, please report bugs or send PRs +to this repository instead of the main repository. From 77ec2397bb81f8e4d7e9f6fa24f244f818d14322 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sat, 24 Sep 2022 23:31:43 +0800 Subject: [PATCH 07/25] Update versions --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 70c389f..7737d29 100644 --- a/composer.json +++ b/composer.json @@ -23,10 +23,10 @@ "homepage": "https://github.com/codeigniter4/devkit", "require": { "php": "^7.4 || ^8.0", - "codeigniter/coding-standard": "^1.1", + "codeigniter/coding-standard": "^1.5", "fakerphp/faker": "^1.9", "mikey179/vfsstream": "^1.6", - "nexusphp/cs-config": "^3.1", + "nexusphp/cs-config": "^3.6", "nexusphp/tachycardia": "^1.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", From 0a8ab8fd75ff9006ff14797cbbd035b84a995917 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 08:53:29 +0000 Subject: [PATCH 08/25] Update rector/rector requirement from 0.14.0 to 0.14.5 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.0...0.14.5) --- 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 70c389f..cc12735 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.0" + "rector/rector": "0.14.5" }, "minimum-stability": "dev", "prefer-stable": true, From e82eba7ee658b80a77bdd7fae4468e5c08377ad2 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sat, 15 Oct 2022 23:13:26 +0800 Subject: [PATCH 09/25] Use environment variables instead of `set-output` --- .github/workflows/phpcsfixer.yml | 5 ++--- .github/workflows/phpstan.yml | 5 ++--- .github/workflows/psalm.yml | 5 ++--- .github/workflows/rector.yml | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index 3b1265e..6e9c639 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -34,13 +34,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 6bdd00f..26a6e20 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -43,13 +43,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 5e6ccf6..274b154 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -39,13 +39,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 36d6d2c..11677a6 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -43,13 +43,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- From 83d70271a70ce75f73cdc0a82eec44a0ab1052a1 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sat, 15 Oct 2022 23:18:51 +0800 Subject: [PATCH 10/25] Update `set-output` usage in `src/Template/.github/` --- src/Template/.github/workflows/deptrac.yml | 5 ++--- src/Template/.github/workflows/infection.yml | 5 ++--- src/Template/.github/workflows/phpcsfixer.yml | 5 ++--- src/Template/.github/workflows/phpstan.yml | 5 ++--- src/Template/.github/workflows/phpunit.yml | 5 ++--- src/Template/.github/workflows/psalm.yml | 5 ++--- src/Template/.github/workflows/rector.yml | 5 ++--- src/Template/.github/workflows/unused.yml | 5 ++--- 8 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/Template/.github/workflows/deptrac.yml b/src/Template/.github/workflows/deptrac.yml index c077f72..ca471f0 100644 --- a/src/Template/.github/workflows/deptrac.yml +++ b/src/Template/.github/workflows/deptrac.yml @@ -39,13 +39,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/src/Template/.github/workflows/infection.yml b/src/Template/.github/workflows/infection.yml index 7f16938..8d2c1dc 100644 --- a/src/Template/.github/workflows/infection.yml +++ b/src/Template/.github/workflows/infection.yml @@ -45,13 +45,12 @@ jobs: uses: mheap/phpunit-matcher-action@v1 - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/src/Template/.github/workflows/phpcsfixer.yml b/src/Template/.github/workflows/phpcsfixer.yml index 3b1265e..6e9c639 100644 --- a/src/Template/.github/workflows/phpcsfixer.yml +++ b/src/Template/.github/workflows/phpcsfixer.yml @@ -34,13 +34,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/src/Template/.github/workflows/phpstan.yml b/src/Template/.github/workflows/phpstan.yml index 6bdd00f..26a6e20 100644 --- a/src/Template/.github/workflows/phpstan.yml +++ b/src/Template/.github/workflows/phpstan.yml @@ -43,13 +43,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/src/Template/.github/workflows/phpunit.yml b/src/Template/.github/workflows/phpunit.yml index c875e33..c8caa4a 100644 --- a/src/Template/.github/workflows/phpunit.yml +++ b/src/Template/.github/workflows/phpunit.yml @@ -42,13 +42,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/src/Template/.github/workflows/psalm.yml b/src/Template/.github/workflows/psalm.yml index 5e6ccf6..274b154 100644 --- a/src/Template/.github/workflows/psalm.yml +++ b/src/Template/.github/workflows/psalm.yml @@ -39,13 +39,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/src/Template/.github/workflows/rector.yml b/src/Template/.github/workflows/rector.yml index c09365d..b15bfcb 100644 --- a/src/Template/.github/workflows/rector.yml +++ b/src/Template/.github/workflows/rector.yml @@ -43,13 +43,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- diff --git a/src/Template/.github/workflows/unused.yml b/src/Template/.github/workflows/unused.yml index b83ccb9..53a0d03 100644 --- a/src/Template/.github/workflows/unused.yml +++ b/src/Template/.github/workflows/unused.yml @@ -37,13 +37,12 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- From de5d1a7d082e84266251cbf9789ac0398244c52a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 08:41:58 +0000 Subject: [PATCH 11/25] Update rector/rector requirement from 0.14.5 to 0.14.6 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.5...0.14.6) --- 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 bf80777..ac76eff 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.5" + "rector/rector": "0.14.6" }, "minimum-stability": "dev", "prefer-stable": true, From 5564a88a18898dbf456a3786bb26d80fb056afe6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 08:16:59 +0000 Subject: [PATCH 12/25] chore(deps-dev): update rector/rector requirement from 0.14.6 to 0.14.7 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.6...0.14.7) --- 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 ac76eff..71a505f 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.6" + "rector/rector": "0.14.7" }, "minimum-stability": "dev", "prefer-stable": true, From 178edbd8fa0c03a3f962e5b0f1c6d313a1415c38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 08:06:13 +0000 Subject: [PATCH 13/25] chore(deps-dev): update rector/rector requirement from 0.14.7 to 0.14.8 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.7...0.14.8) --- 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 71a505f..e476275 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.7" + "rector/rector": "0.14.8" }, "minimum-stability": "dev", "prefer-stable": true, From 803b59c987a261d96cd8275efecfff7a6e994156 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 17 Nov 2022 20:59:43 +0900 Subject: [PATCH 14/25] fix: restore current directory baseline.xml was created in system/Helpers/. --- psalm_autoload.php | 2 ++ src/Template/psalm_autoload.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/psalm_autoload.php b/psalm_autoload.php index 5a25347..214c9fb 100644 --- a/psalm_autoload.php +++ b/psalm_autoload.php @@ -18,3 +18,5 @@ require_once $filePath; } } + +chdir(__DIR__); diff --git a/src/Template/psalm_autoload.php b/src/Template/psalm_autoload.php index 30e9fbf..4c33092 100644 --- a/src/Template/psalm_autoload.php +++ b/src/Template/psalm_autoload.php @@ -23,3 +23,5 @@ require_once $filePath; } } + +chdir(__DIR__); From e20f8aca62a4e504118e584e9fc635a6a84ce6f4 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 3 Dec 2022 09:29:23 +0900 Subject: [PATCH 15/25] chore: update psalm to ^5.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e476275..eba5669 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^9.3", "roave/security-advisories": "dev-latest", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^5.0" }, "require-dev": { "codeigniter4/framework": "^4.1", 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 16/25] 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 17/25] 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 18/25] 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 19/25] 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 20/25] 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]); From 29d90f7d5ef4cde234e10f9231926bc0d67a7421 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 15 Dec 2022 09:46:14 +0900 Subject: [PATCH 21/25] chore: add rector.php to php-cs-fixer --- .php-cs-fixer.dist.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index ac7cd76..d5b03cb 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -10,7 +10,10 @@ __DIR__ . '/src/', ]) ->exclude('build') - ->append([__FILE__]); + ->append([ + __FILE__, + __DIR__ . '/rector.php', + ]); $overrides = []; From 0bf0998756a9b6de7101ea0f69a1736a4d8d0b01 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 15 Dec 2022 09:50:26 +0900 Subject: [PATCH 22/25] Update rector version --- .github/workflows/rector.yml | 2 +- composer.json | 2 +- src/Template/.github/workflows/rector.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 3aef723..d91db3c 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.15.0 + composer global require --dev rector/rector:^0.15.1 rector process --dry-run --no-progress-bar diff --git a/composer.json b/composer.json index e7c4e8c..2596b47 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.15.0" + "rector/rector": "0.15.1" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Template/.github/workflows/rector.yml b/src/Template/.github/workflows/rector.yml index b15bfcb..d91db3c 100644 --- a/src/Template/.github/workflows/rector.yml +++ b/src/Template/.github/workflows/rector.yml @@ -62,5 +62,5 @@ jobs: - name: Analyze for refactoring run: | - composer global require --dev rector/rector:^0.14 + composer global require --dev rector/rector:^0.15.1 rector process --dry-run --no-progress-bar From 786ef6918c05db1dca9923e94bd72f66664d7736 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 15 Dec 2022 09:49:19 +0900 Subject: [PATCH 23/25] Update rector.php From shield. --- rector.php | 20 ++++++++++++++++++-- src/Template/rector.php | 21 ++++++++++++++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/rector.php b/rector.php index 19e4b3a..356660e 100644 --- a/rector.php +++ b/rector.php @@ -1,6 +1,7 @@ sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitSetList::PHPUNIT_80]); + $rectorConfig->sets([ + SetList::DEAD_CODE, + LevelSetList::UP_TO_PHP_74, + PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, + PHPUnitSetList::PHPUNIT_100, + ]); + $rectorConfig->parallel(); + // The paths to refactor (can also be supplied with CLI arguments) $rectorConfig->paths([ __DIR__ . '/src/', @@ -78,7 +87,7 @@ __DIR__ . '/tests', ], - // Ignore files that should not be namespaced + // Ignore files that should not be namespaced to their folder NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [ __DIR__ . '/src/Helpers', ], @@ -89,6 +98,10 @@ // May be uninitialized on purpose AddDefaultValueForUndefinedVariableRector::class, ]); + + // auto import fully qualified class names + $rectorConfig->importNames(); + $rectorConfig->rule(SimplifyUselessVariableRector::class); $rectorConfig->rule(RemoveAlwaysElseRector::class); $rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class); @@ -116,4 +129,7 @@ // Set to false if you use in libraries, or it does create breaking changes. TypedPropertyFromAssignsRector::INLINE_PUBLIC => true, ]); + $rectorConfig->rule(StringClassNameToClassConstantRector::class); + $rectorConfig->rule(PrivatizeFinalClassPropertyRector::class); + $rectorConfig->rule(CompleteDynamicPropertiesRector::class); }; diff --git a/src/Template/rector.php b/src/Template/rector.php index e11a68b..3c85e50 100644 --- a/src/Template/rector.php +++ b/src/Template/rector.php @@ -1,6 +1,7 @@ sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitLevelSetList::UP_TO_PHPUNIT_100]); + $rectorConfig->sets([ + SetList::DEAD_CODE, + LevelSetList::UP_TO_PHP_74, + PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, + PHPUnitSetList::PHPUNIT_100, + ]); + $rectorConfig->parallel(); + // The paths to refactor (can also be supplied with CLI arguments) $rectorConfig->paths([ __DIR__ . '/app/', @@ -80,7 +88,7 @@ __DIR__ . '/tests', ], - // Ignore files that should not be namespaced + // Ignore files that should not be namespaced to their folder NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [ __DIR__ . '/app/Helpers', ], @@ -91,6 +99,10 @@ // May be uninitialized on purpose AddDefaultValueForUndefinedVariableRector::class, ]); + + // auto import fully qualified class names + $rectorConfig->importNames(); + $rectorConfig->rule(SimplifyUselessVariableRector::class); $rectorConfig->rule(RemoveAlwaysElseRector::class); $rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class); @@ -118,4 +130,7 @@ // Set to false if you use in libraries, or it does create breaking changes. TypedPropertyFromAssignsRector::INLINE_PUBLIC => true, ]); + $rectorConfig->rule(StringClassNameToClassConstantRector::class); + $rectorConfig->rule(PrivatizeFinalClassPropertyRector::class); + $rectorConfig->rule(CompleteDynamicPropertiesRector::class); }; From ac9359a417e8895cb7ba35f26150f8384345c4b8 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 16 Dec 2022 13:59:18 +0700 Subject: [PATCH 24/25] [Rector] Update comment usage for TypedPropertyFromAssignsRector --- rector.php | 5 ++++- src/Template/rector.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rector.php b/rector.php index 356660e..3e8ab23 100644 --- a/rector.php +++ b/rector.php @@ -126,7 +126,10 @@ $rectorConfig->rule(NormalizeNamespaceByPSR4ComposerAutoloadRector::class); $rectorConfig ->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [ - // Set to false if you use in libraries, or it does create breaking changes. + /** + * The INLINE_PUBLIC value is default to false to avoid BC break, if you use for libraries and want to preserve BC break, you don't need to configure it, as it included in LevelSetList::UP_TO_PHP_74 + * Set to true for projects that allow BC break + */ TypedPropertyFromAssignsRector::INLINE_PUBLIC => true, ]); $rectorConfig->rule(StringClassNameToClassConstantRector::class); diff --git a/src/Template/rector.php b/src/Template/rector.php index 3c85e50..6b236dc 100644 --- a/src/Template/rector.php +++ b/src/Template/rector.php @@ -127,7 +127,10 @@ $rectorConfig->rule(NormalizeNamespaceByPSR4ComposerAutoloadRector::class); $rectorConfig ->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [ - // Set to false if you use in libraries, or it does create breaking changes. + /** + * The INLINE_PUBLIC value is default to false to avoid BC break, if you use for libraries and want to preserve BC break, you don't need to configure it, as it included in LevelSetList::UP_TO_PHP_74 + * Set to true for projects that allow BC break + */ TypedPropertyFromAssignsRector::INLINE_PUBLIC => true, ]); $rectorConfig->rule(StringClassNameToClassConstantRector::class); From 51a46eb8769205ca5f4dcf9ca45488ac27376c89 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 19 Dec 2022 08:43:46 +0900 Subject: [PATCH 25/25] Update php-cs-fixer.dist.php --- src/Template/.php-cs-fixer.dist.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Template/.php-cs-fixer.dist.php b/src/Template/.php-cs-fixer.dist.php index 26b8ac2..8fc31b3 100644 --- a/src/Template/.php-cs-fixer.dist.php +++ b/src/Template/.php-cs-fixer.dist.php @@ -10,10 +10,19 @@ __DIR__ . '/app/', __DIR__ . '/tests/', ]) - ->exclude('build') - ->append([__FILE__]); + ->exclude([ + 'build', + 'Views', + ]) + ->append([ + __FILE__, + __DIR__ . '/rector.php', + ]); -$overrides = []; +$overrides = [ + // 'declare_strict_types' => true, + // 'void_return' => true, +]; $options = [ 'finder' => $finder,