From 7fb8c7dc962a7d3f12d2ab1b5b24e486c665d547 Mon Sep 17 00:00:00 2001 From: MGatner Date: Sun, 7 Nov 2021 15:30:02 +0000 Subject: [PATCH 01/58] Refresh toolkit --- .github/workflows/deduplicate.yml | 14 ++++---- .github/workflows/inspect.yml | 4 +-- .github/workflows/test.yml | 10 +++--- .github/workflows/unused.yml | 60 +++++++++++++++++++++++++++++++ composer.json | 2 +- depfile.yaml | 3 ++ 6 files changed, 77 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/unused.yml diff --git a/.github/workflows/deduplicate.yml b/.github/workflows/deduplicate.yml index 0b3994c..827bbbc 100644 --- a/.github/workflows/deduplicate.yml +++ b/.github/workflows/deduplicate.yml @@ -7,16 +7,18 @@ on: branches: - 'develop' paths: + - 'app/**' - 'src/**' - 'tests/**' - - '.github/workflows/test-phpcpd.yml' + - '.github/workflows/deduplicate.yml' push: branches: - 'develop' paths: + - 'app/**' - 'src/**' - 'tests/**' - - '.github/workflows/test-phpcpd.yml' + - '.github/workflows/deduplicate.yml' jobs: build: @@ -30,10 +32,8 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.0' - tools: phive - extensions: intl, json, mbstring, xml + tools: phpcpd + extensions: dom, mbstring - name: Detect code duplication - run: | - sudo phive --no-progress install --global --trust-gpg-keys 4AA394086372C20A phpcpd - phpcpd src/ tests/ + run: phpcpd app/ src/ tests/ diff --git a/.github/workflows/inspect.yml b/.github/workflows/inspect.yml index 9ad7ee5..23440fe 100644 --- a/.github/workflows/inspect.yml +++ b/.github/workflows/inspect.yml @@ -75,5 +75,5 @@ jobs: - name: Run architectural inspection run: | - sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac - deptrac analyze --cache-file=build/deptrac.cache + sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac + deptrac analyze --cache-file=build/deptrac.cache diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb22f52..f19ff7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - tools: composer, pecl, phpunit + tools: composer, pecl, phive, phpunit extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3 coverage: xdebug env: @@ -55,9 +55,6 @@ jobs: env: COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} - - name: Enable Tachycardia - run: echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV - - name: Test with PHPUnit run: vendor/bin/phpunit --verbose --coverage-text env: @@ -66,9 +63,10 @@ jobs: - if: matrix.php-versions == '8.0' name: Run Coveralls + continue-on-error: true run: | - composer require php-coveralls/php-coveralls - vendor/bin/php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json + sudo phive --no-progress install --global --trust-gpg-keys E82B2FB314E9906E php-coveralls + php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_PARALLEL: true diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml new file mode 100644 index 0000000..4d2ee36 --- /dev/null +++ b/.github/workflows/unused.yml @@ -0,0 +1,60 @@ +# When a PR is opened or a push is made, check code +# for unused packages with Composer Unused. +name: Unused + +on: + pull_request: + branches: + - 'develop' + paths: + - 'src/**' + - 'tests/**' + - '.github/workflows/unused.yml' + push: + branches: + - 'develop' + paths: + - 'src/**' + - 'tests/**' + - '.github/workflows/unused.yml' + +jobs: + build: + name: Unused Package Detection + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + tools: composer, composer-unused + extensions: intl, json, mbstring, xml + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies (limited) + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} + run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + + - name: Install dependencies (authenticated) + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} + run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + env: + COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} + + - name: Detect unused packages + run: composer-unused -vvv --profile --ansi --no-interaction --no-progress --excludePackage=php diff --git a/composer.json b/composer.json index 1395a71..575b75b 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "nexusphp/cs-config": "^3.1", "nexusphp/tachycardia": "^1.0", "php-coveralls/php-coveralls": "^2.4", - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^1.0", "phpunit/phpunit": "^9.5", "roave/security-advisories": "dev-latest" }, diff --git a/depfile.yaml b/depfile.yaml index e039a7c..23e144a 100644 --- a/depfile.yaml +++ b/depfile.yaml @@ -108,6 +108,7 @@ ruleset: - Entity - Service - Vendor Config + - Vendor Entity - Vendor Model Service: - Config @@ -115,6 +116,7 @@ ruleset: # Ignore anything in the Vendor layers Vendor Model: + - Config - Service - Vendor Config - Vendor Controller @@ -129,6 +131,7 @@ ruleset: - Vendor Model - Vendor View Vendor Config: + - Config - Service - Vendor Config - Vendor Controller From 59412d4154c0c29b17746883ce2385c35d7afcce Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 3 Jun 2022 08:43:23 +0900 Subject: [PATCH 02/58] docs: small tweaks --- README.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9eacc00..c0771b9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # CodeIgniter 4 PSR Cache -PSR-6 and PSR-16 Cache Adapters for CodeIgniter 4 + +PSR-6 and PSR-16 Cache Adapters for CodeIgniter 4 [![](https://github.com/codeigniter4/cache/workflows/PHPUnit/badge.svg)](https://github.com/codeigniter4/cache/actions/workflows/test.yml) [![](https://github.com/codeigniter4/cache/workflows/PHPStan/badge.svg)](https://github.com/codeigniter4/cache/actions/workflows/analyze.yml) @@ -13,7 +14,8 @@ is only for integrating third-party packages that rely on the PSR interface prov 1. Install with Composer: `> composer require codeigniter4/cache` 2. Integrate with your favorite packages: -``` + +```php use CodeIgniter\Psr\Cache\SimeplCache; use Kreait\Firebase\Factory; ... @@ -29,6 +31,7 @@ A set of adapters fully-compliant with PSR-6 and PSR-16 to integrate with CodeIg Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date: + * `> composer require codeigniter4/cache` Or, install manually by downloading the source files and adding the directory to @@ -42,10 +45,12 @@ This module has adapters for CodeIgniter 4 to supply the following FIG PHP Stand If you just need a caching agent then you should use the framework's native [Caching Driver](https://codeigniter4.github.io/CodeIgniter4/libraries/caching.html). These adapters are intended to integrate with any library or project that requires either of the following: + * [psr/cache-implementation](https://packagist.org/packages/psr/cache/dependents?order_by=downloads) * [psr/simple-cache-implementation](https://packagist.org/packages/psr/simple-cache/dependents?order_by=downloads) The interfaces are provided by the following classes: + * `Psr\Cache\CacheItemInterface` provided by `CodeIgniter\Psr\Cache\Item` * `Psr\Cache\CacheItemPoolInterface` provided by `CodeIgniter\Psr\Cache\Pool` * `Psr\SimpleCache\CacheInterface` provided by `CodeIgniter\Psr\Cache\SimpleCache` @@ -53,15 +58,16 @@ The interfaces are provided by the following classes: By default the adapters (`Pool` and `SimpleCache`) will work with the Caching Driver as defined in you cache configuration (e.g. **app/Config/Cache.php**). You may create either driver explicitly with an alternative Cache Handler or Config: -``` - $sharedCacheServicePool = new \CodeIgniter\Psr\Cache\Pool(); - $fileHandler = new \CodeIgniter\Cache\Handlers\FileHandler(config('Cache')); - $explicitFileHandlerSimpleCache = new \CodeIgniter\Psr\Cache\SimpleCache($fileHandler); +```php + $sharedCacheServicePool = new \CodeIgniter\Psr\Cache\Pool(); - $config = config('Cache'); - $config->prefix = 'banana-'; - $alternativeConfigPool = new \CodeIgniter\Psr\Cache\Pool($config); + $fileHandler = new \CodeIgniter\Cache\Handlers\FileHandler(config('Cache')); + $explicitFileHandlerSimpleCache = new \CodeIgniter\Psr\Cache\SimpleCache($fileHandler); + + $config = config('Cache'); + $config->prefix = 'banana-'; + $alternativeConfigPool = new \CodeIgniter\Psr\Cache\Pool($config); ``` ## Testing @@ -69,4 +75,5 @@ with an alternative Cache Handler or Config: Testing of the underlying Caching Driver is handled in the [CodeIgniter 4 repo](https://github.com/codeigniter4/CodeIgniter4/tree/develop/tests/system/Cache). These adapters are tested with the [PHP Cache Integration Tests](https://github.com/php-cache/integration-tests), by Aaron Scherer. You may run the test suite by cloning this repo, installing all dependencies, and running: + * `> composer test` From 22dac7c14aea83832859af5ddfcfd0657ad32fe8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 3 Jun 2022 09:09:35 +0900 Subject: [PATCH 03/58] chore: update github workflow files --- .github/workflows/analyze.yml | 81 --------------------- .github/workflows/deduplicate.yml | 39 ---------- .github/workflows/deptrac.yml | 73 +++++++++++++++++++ .github/workflows/inspect.yml | 79 -------------------- .github/workflows/phpcpd.yml | 36 +++++++++ .github/workflows/phpstan.yml | 75 +++++++++++++++++++ .github/workflows/{test.yml => phpunit.yml} | 48 ++++++------ .github/workflows/unused.yml | 41 +++++------ 8 files changed, 231 insertions(+), 241 deletions(-) delete mode 100644 .github/workflows/analyze.yml delete mode 100644 .github/workflows/deduplicate.yml create mode 100644 .github/workflows/deptrac.yml delete mode 100644 .github/workflows/inspect.yml create mode 100644 .github/workflows/phpcpd.yml create mode 100644 .github/workflows/phpstan.yml rename .github/workflows/{test.yml => phpunit.yml} (67%) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml deleted file mode 100644 index 12c48c1..0000000 --- a/.github/workflows/analyze.yml +++ /dev/null @@ -1,81 +0,0 @@ -# When a PR is opened or a push is made, perform -# a static analysis check on the code using PHPStan. -name: PHPStan - -on: - pull_request: - branches: - - 'develop' - paths: - - 'src/**' - - 'tests/**' - - 'composer.**' - - 'phpstan*' - - '.github/workflows/analyze.yml' - push: - branches: - - 'develop' - paths: - - 'src/**' - - 'tests/**' - - 'composer.**' - - 'phpstan*' - - '.github/workflows/analyze.yml' - -jobs: - build: - name: PHP ${{ matrix.php-versions }} Static Analysis - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php-versions: ['7.3', '7.4', '8.0'] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - tools: composer, pecl, phpunit - extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3 - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Create composer cache directory - run: mkdir -p ${{ steps.composer-cache.outputs.dir }} - - - name: Cache composer dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Create PHPStan cache directory - run: mkdir -p build/phpstan - - - name: Cache PHPStan results - uses: actions/cache@v2 - with: - path: build/phpstan - key: ${{ runner.os }}-phpstan-${{ github.sha }} - restore-keys: ${{ runner.os }}-phpstan- - - - name: Install dependencies (limited) - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - - - name: Install dependencies (authenticated) - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} - - - name: Run static analysis - run: vendor/bin/phpstan analyze diff --git a/.github/workflows/deduplicate.yml b/.github/workflows/deduplicate.yml deleted file mode 100644 index 827bbbc..0000000 --- a/.github/workflows/deduplicate.yml +++ /dev/null @@ -1,39 +0,0 @@ -# When a PR is opened or a push is made, check code -# for duplication with PHP Copy/Paste Detector. -name: PHPCPD - -on: - pull_request: - branches: - - 'develop' - paths: - - 'app/**' - - 'src/**' - - 'tests/**' - - '.github/workflows/deduplicate.yml' - push: - branches: - - 'develop' - paths: - - 'app/**' - - 'src/**' - - 'tests/**' - - '.github/workflows/deduplicate.yml' - -jobs: - build: - name: Duplicate Code Detection - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - tools: phpcpd - extensions: dom, mbstring - - - name: Detect code duplication - run: phpcpd app/ src/ tests/ diff --git a/.github/workflows/deptrac.yml b/.github/workflows/deptrac.yml new file mode 100644 index 0000000..441c74d --- /dev/null +++ b/.github/workflows/deptrac.yml @@ -0,0 +1,73 @@ +name: Deptrac + +on: + pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'depfile.yaml' + - '.github/workflows/deptrac.yml' + push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'depfile.yaml' + - '.github/workflows/deptrac.yml' + +jobs: + build: + name: Dependency Tracing + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + tools: phive + extensions: intl, json, mbstring, xml + coverage: none + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Create Deptrac cache directory + run: mkdir -p build/ + + - name: Cache Deptrac results + uses: actions/cache@v3 + with: + path: build + key: ${{ runner.os }}-deptrac-${{ github.sha }} + restore-keys: ${{ runner.os }}-deptrac- + + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi + + - name: Trace dependencies + run: | + sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac + deptrac analyze --cache-file=build/deptrac.cache diff --git a/.github/workflows/inspect.yml b/.github/workflows/inspect.yml deleted file mode 100644 index 23440fe..0000000 --- a/.github/workflows/inspect.yml +++ /dev/null @@ -1,79 +0,0 @@ -# When a PR is opened or a push is made, perform an -# architectural inspection on the code using Deptrac. -name: Deptrac - -on: - pull_request: - branches: - - 'develop' - paths: - - 'src/**' - - 'tests/**' - - 'composer.**' - - 'depfile.yaml' - - '.github/workflows/inspect.yml' - push: - branches: - - 'develop' - paths: - - 'src/**' - - 'tests/**' - - 'composer.**' - - 'depfile.yaml' - - '.github/workflows/inspect.yml' - -jobs: - build: - name: Architectural Inspection - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - tools: composer, pecl, phive - extensions: intl, json, mbstring, xml - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Create composer cache directory - run: mkdir -p ${{ steps.composer-cache.outputs.dir }} - - - name: Cache composer dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Create Deptrac cache directory - run: mkdir -p build/ - - - name: Cache Deptrac results - uses: actions/cache@v2 - with: - path: build - key: ${{ runner.os }}-deptrac-${{ github.sha }} - restore-keys: ${{ runner.os }}-deptrac- - - - name: Install dependencies (limited) - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - - - name: Install dependencies (authenticated) - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} - - - name: Run architectural inspection - run: | - sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac - deptrac analyze --cache-file=build/deptrac.cache diff --git a/.github/workflows/phpcpd.yml b/.github/workflows/phpcpd.yml new file mode 100644 index 0000000..d6a877d --- /dev/null +++ b/.github/workflows/phpcpd.yml @@ -0,0 +1,36 @@ +name: PHPCPD + +on: + pull_request: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcpd.yml' + push: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcpd.yml' + +jobs: + build: + name: Code Copy-Paste Detection + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + tools: phpcpd + extensions: dom, mbstring + coverage: none + + - name: Detect duplicate code + run: phpcpd src/ tests/ diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..6bdd00f --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,75 @@ +name: PHPStan + +on: + pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'phpstan*' + - '.github/workflows/phpstan.yml' + push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'phpstan*' + - '.github/workflows/phpstan.yml' + +jobs: + build: + name: PHP ${{ matrix.php-versions }} Static Analysis + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + strategy: + fail-fast: false + matrix: + php-versions: ['7.4', '8.0', '8.1'] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: phpstan, phpunit + extensions: intl, json, mbstring, xml + coverage: none + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Create PHPStan cache directory + run: mkdir -p build/phpstan + + - name: Cache PHPStan results + uses: actions/cache@v3 + with: + path: build/phpstan + key: ${{ runner.os }}-phpstan-${{ github.sha }} + restore-keys: ${{ runner.os }}-phpstan- + + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi + + - name: Run static analysis + run: vendor/bin/phpstan analyze diff --git a/.github/workflows/test.yml b/.github/workflows/phpunit.yml similarity index 67% rename from .github/workflows/test.yml rename to .github/workflows/phpunit.yml index f19ff7e..c875e33 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/phpunit.yml @@ -4,32 +4,39 @@ on: pull_request: branches: - develop + paths: + - '**.php' + - 'composer.*' + - 'phpunit*' + - '.github/workflows/phpunit.yml' push: branches: - develop + paths: + - '**.php' + - 'composer.*' + - 'phpunit*' + - '.github/workflows/phpunit.yml' jobs: main: name: PHP ${{ matrix.php-versions }} Unit Tests - - strategy: - matrix: - php-versions: ['7.3', '7.4', '8.0'] - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" + strategy: + matrix: + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Setup PHP, with composer and extensions + - name: Set up PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - tools: composer, pecl, phive, phpunit - extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3 + tools: composer, phive, phpunit + extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3 coverage: xdebug env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -39,21 +46,19 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies (limited) - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - - - name: Install dependencies (authenticated) - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi - name: Test with PHPUnit run: vendor/bin/phpunit --verbose --coverage-text @@ -79,6 +84,7 @@ jobs: steps: - name: Upload Coveralls results uses: coverallsapp/github-action@master + continue-on-error: true with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml index 4d2ee36..b02fab6 100644 --- a/.github/workflows/unused.yml +++ b/.github/workflows/unused.yml @@ -1,30 +1,30 @@ -# When a PR is opened or a push is made, check code -# for unused packages with Composer Unused. name: Unused on: pull_request: branches: - - 'develop' + - develop paths: - - 'src/**' - - 'tests/**' + - '**.php' + - 'composer.*' - '.github/workflows/unused.yml' push: branches: - - 'develop' + - develop paths: - - 'src/**' - - 'tests/**' + - '**.php' + - 'composer.*' - '.github/workflows/unused.yml' jobs: build: name: Unused Package Detection runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -32,6 +32,7 @@ jobs: php-version: '8.0' tools: composer, composer-unused extensions: intl, json, mbstring, xml + coverage: none env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -40,21 +41,19 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies (limited) - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - - - name: Install dependencies (authenticated) - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi - name: Detect unused packages - run: composer-unused -vvv --profile --ansi --no-interaction --no-progress --excludePackage=php + run: composer-unused -vvv --output-format=github --ansi --no-interaction --no-progress From a9e64419e7e949da0a2af81a3e270d2e9ce844ec Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 3 Jun 2022 09:10:19 +0900 Subject: [PATCH 04/58] chore: update deptrac config file --- depfile.yaml | 155 -------------------------------------------------- deptrac.yaml | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+), 155 deletions(-) delete mode 100644 depfile.yaml create mode 100644 deptrac.yaml diff --git a/depfile.yaml b/depfile.yaml deleted file mode 100644 index 23e144a..0000000 --- a/depfile.yaml +++ /dev/null @@ -1,155 +0,0 @@ -paths: - - ./src - - ./vendor/codeigniter4/codeigniter4/system -exclude_files: - - '#.*test.*#i' -layers: - - name: Model - collectors: - - type: bool - must: - - type: className - regex: .*[A-Za-z]+Model$ - must_not: - - type: directory - regex: vendor/.* - - name: Vendor Model - collectors: - - type: bool - must: - - type: className - regex: .*[A-Za-z]+Model$ - - type: directory - regex: vendor/.* - - name: Controller - collectors: - - type: bool - must: - - type: className - regex: .*\/Controllers\/.* - must_not: - - type: directory - regex: vendor/.* - - name: Vendor Controller - collectors: - - type: bool - must: - - type: className - regex: .*\/Controllers\/.* - - type: directory - regex: vendor/.* - - name: Config - collectors: - - type: bool - must: - - type: directory - regex: src/Config/.* - must_not: - - type: className - regex: .*Services - - type: directory - regex: vendor/.* - - name: Vendor Config - collectors: - - type: bool - must: - - type: directory - regex: vendor/.*/Config/.* - must_not: - - type: className - regex: .*Services - - name: Entity - collectors: - - type: bool - must: - - type: directory - regex: src/Entities/.* - must_not: - - type: directory - regex: vendor/.* - - name: Vendor Entity - collectors: - - type: bool - must: - - type: directory - regex: vendor/.*/Entities/.* - - name: View - collectors: - - type: bool - must: - - type: directory - regex: src/Views/.* - must_not: - - type: directory - regex: vendor/.* - - name: Vendor View - collectors: - - type: bool - must: - - type: directory - regex: vendor/.*/Views/.* - - name: Service - collectors: - - type: className - regex: .*Services.* -ruleset: - Entity: - - Config - - Model - - Service - - Vendor Config - - Vendor Entity - - Vendor Model - Config: - - Service - - Vendor Config - Model: - - Config - - Entity - - Service - - Vendor Config - - Vendor Entity - - Vendor Model - Service: - - Config - - Vendor Config - - # Ignore anything in the Vendor layers - Vendor Model: - - Config - - Service - - Vendor Config - - Vendor Controller - - Vendor Entity - - Vendor Model - - Vendor View - Vendor Controller: - - Service - - Vendor Config - - Vendor Controller - - Vendor Entity - - Vendor Model - - Vendor View - Vendor Config: - - Config - - Service - - Vendor Config - - Vendor Controller - - Vendor Entity - - Vendor Model - - Vendor View - Vendor Entity: - - Service - - Vendor Config - - Vendor Controller - - Vendor Entity - - Vendor Model - - Vendor View - Vendor View: - - Service - - Vendor Config - - Vendor Controller - - Vendor Entity - - Vendor Model - - Vendor View -skip_violations: diff --git a/deptrac.yaml b/deptrac.yaml new file mode 100644 index 0000000..bac0b93 --- /dev/null +++ b/deptrac.yaml @@ -0,0 +1,156 @@ +parameters: + paths: + - ./src + - ./vendor/codeigniter4/codeigniter4/system + exclude_files: + - '#.*test.*#i' + layers: + - name: Model + collectors: + - type: bool + must: + - type: className + regex: .*[A-Za-z]+Model$ + must_not: + - type: directory + regex: vendor/.* + - name: Vendor Model + collectors: + - type: bool + must: + - type: className + regex: .*[A-Za-z]+Model$ + - type: directory + regex: vendor/.* + - name: Controller + collectors: + - type: bool + must: + - type: className + regex: .*\/Controllers\/.* + must_not: + - type: directory + regex: vendor/.* + - name: Vendor Controller + collectors: + - type: bool + must: + - type: className + regex: .*\/Controllers\/.* + - type: directory + regex: vendor/.* + - name: Config + collectors: + - type: bool + must: + - type: directory + regex: src/Config/.* + must_not: + - type: className + regex: .*Services + - type: directory + regex: vendor/.* + - name: Vendor Config + collectors: + - type: bool + must: + - type: directory + regex: vendor/.*/Config/.* + must_not: + - type: className + regex: .*Services + - name: Entity + collectors: + - type: bool + must: + - type: directory + regex: src/Entities/.* + must_not: + - type: directory + regex: vendor/.* + - name: Vendor Entity + collectors: + - type: bool + must: + - type: directory + regex: vendor/.*/Entities/.* + - name: View + collectors: + - type: bool + must: + - type: directory + regex: src/Views/.* + must_not: + - type: directory + regex: vendor/.* + - name: Vendor View + collectors: + - type: bool + must: + - type: directory + regex: vendor/.*/Views/.* + - name: Service + collectors: + - type: className + regex: .*Services.* + ruleset: + Entity: + - Config + - Model + - Service + - Vendor Config + - Vendor Entity + - Vendor Model + Config: + - Service + - Vendor Config + Model: + - Config + - Entity + - Service + - Vendor Config + - Vendor Entity + - Vendor Model + Service: + - Config + - Vendor Config + + # Ignore anything in the Vendor layers + Vendor Model: + - Config + - Service + - Vendor Config + - Vendor Controller + - Vendor Entity + - Vendor Model + - Vendor View + Vendor Controller: + - Service + - Vendor Config + - Vendor Controller + - Vendor Entity + - Vendor Model + - Vendor View + Vendor Config: + - Config + - Service + - Vendor Config + - Vendor Controller + - Vendor Entity + - Vendor Model + - Vendor View + Vendor Entity: + - Service + - Vendor Config + - Vendor Controller + - Vendor Entity + - Vendor Model + - Vendor View + Vendor View: + - Service + - Vendor Config + - Vendor Controller + - Vendor Entity + - Vendor Model + - Vendor View + skip_violations: From 6e12f5e84618579b1757f3d7dacaff26b24c81f5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 3 Jun 2022 09:11:11 +0900 Subject: [PATCH 05/58] chore: update PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 575b75b..2d3ccf0 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "psr/cache": "^1.0", "psr/simple-cache": "^1.0" }, From 3e717fc9c91bcc06655c39b92cb89a2f141a9a12 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 3 Jun 2022 09:11:29 +0900 Subject: [PATCH 06/58] chore: add editorconfig --- .editorconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7382bb8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_size = 4 +indent_style = space +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{yml,yaml}] +indent_size = 2 From 152e8b2abb31c2968bca15aa4f632a145eec6538 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 3 Jun 2022 09:12:21 +0900 Subject: [PATCH 07/58] chore: add .idea/ to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 11192f3..6f3cfe7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ phpunit *.cache composer.lock .DS_Store +.idea/ From 33a202aeaeaf4393aa23e2cc7184e723d58c22e1 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 3 Jun 2022 09:15:02 +0900 Subject: [PATCH 08/58] chore: update actions/checkout --- .github/workflows/compare.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml index c6b5e9b..9897358 100644 --- a/.github/workflows/compare.yml +++ b/.github/workflows/compare.yml @@ -14,7 +14,7 @@ jobs: name: Compare for Backwards Compatibility runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 From e1d1e19f6550e49f6d831cb9c27186340b3602b3 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 3 Jun 2022 09:15:36 +0900 Subject: [PATCH 09/58] chore: add `|| ^3.0` for psr/simple-cache-implementation --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2d3ccf0..b303acb 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "provide": { "psr/cache-implementation": "^1.0", - "psr/simple-cache-implementation": "^1.0" + "psr/simple-cache-implementation": "^1.0 || ^3.0" }, "require-dev": { "cache/integration-tests": "^0.17.0", From 09c431824ffa141e2d0bd5d195ada3589a014e9c Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 3 Jun 2022 21:06:32 +0900 Subject: [PATCH 10/58] docs: update Badges --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9eacc00..d4af06e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # CodeIgniter 4 PSR Cache PSR-6 and PSR-16 Cache Adapters for CodeIgniter 4 -[![](https://github.com/codeigniter4/cache/workflows/PHPUnit/badge.svg)](https://github.com/codeigniter4/cache/actions/workflows/test.yml) -[![](https://github.com/codeigniter4/cache/workflows/PHPStan/badge.svg)](https://github.com/codeigniter4/cache/actions/workflows/analyze.yml) -[![](https://github.com/codeigniter4/cache/workflows/Deptrac/badge.svg)](https://github.com/codeigniter4/cache/actions/workflows/inspect.yml) +[![](https://github.com/codeigniter4/cache/workflows/PHPUnit/badge.svg)](https://github.com/codeigniter4/cache/actions/workflows/phpunit.yml) +[![](https://github.com/codeigniter4/cache/workflows/PHPStan/badge.svg)](https://github.com/codeigniter4/cache/actions/workflows/phpstan.yml) +[![](https://github.com/codeigniter4/cache/workflows/Deptrac/badge.svg)](https://github.com/codeigniter4/cache/actions/workflows/deptrac.yml) [![Coverage Status](https://coveralls.io/repos/github/codeigniter4/cache/badge.svg?branch=develop)](https://coveralls.io/github/codeigniter4/cache?branch=develop) **Disclaimer: CodeIgniter 4 comes with a fully-functional cache component! This module From da875968965cf7dd0c810feabc369002ac1b9bec Mon Sep 17 00:00:00 2001 From: MGatner Date: Wed, 22 Jun 2022 13:09:54 +0000 Subject: [PATCH 11/58] Switch to framework stable --- composer.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/composer.json b/composer.json index b303acb..79c507c 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "require-dev": { "cache/integration-tests": "^0.17.0", "codeigniter/coding-standard": "^1.1", - "codeigniter4/codeigniter4": "dev-develop", + "codeigniter4/framework": "^4.1", "nexusphp/cs-config": "^3.1", "nexusphp/tachycardia": "^1.0", "php-coveralls/php-coveralls": "^2.4", @@ -51,12 +51,6 @@ "Tests\\Support\\": "tests/_support" } }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/codeigniter4/CodeIgniter4" - } - ], "minimum-stability": "dev", "prefer-stable": true, "scripts": { From fa7f6892ef63a79b7c3eda70d1c32a20f8c29ee7 Mon Sep 17 00:00:00 2001 From: MGatner Date: Wed, 22 Jun 2022 13:18:52 +0000 Subject: [PATCH 12/58] Normalize Composer --- composer.json | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 79c507c..013b072 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,8 @@ { "name": "codeigniter4/cache", - "type": "library", "description": "PSR-6 and PSR-16 Cache Adapters for CodeIgniter 4", + "license": "MIT", + "type": "library", "keywords": [ "codeigniter", "codeigniter4", @@ -11,8 +12,6 @@ "psr-6", "psr-16" ], - "homepage": "https://github.com/codeigniter4/cache", - "license": "MIT", "authors": [ { "name": "Matthew Gatner", @@ -21,15 +20,12 @@ "role": "Developer" } ], + "homepage": "https://github.com/codeigniter4/cache", "require": { "php": "^7.4 || ^8.0", "psr/cache": "^1.0", "psr/simple-cache": "^1.0" }, - "provide": { - "psr/cache-implementation": "^1.0", - "psr/simple-cache-implementation": "^1.0 || ^3.0" - }, "require-dev": { "cache/integration-tests": "^0.17.0", "codeigniter/coding-standard": "^1.1", @@ -41,26 +37,42 @@ "phpunit/phpunit": "^9.5", "roave/security-advisories": "dev-latest" }, + "provide": { + "psr/cache-implementation": "^1.0", + "psr/simple-cache-implementation": "^1.0 || ^3.0" + }, + "minimum-stability": "dev", + "prefer-stable": true, "autoload": { "psr-4": { "CodeIgniter\\Psr\\Cache\\": "src" - } + }, + "exclude-from-classmap": [ + "**/Database/Migrations/**" + ] }, "autoload-dev": { "psr-4": { "Tests\\Support\\": "tests/_support" } }, - "minimum-stability": "dev", - "prefer-stable": true, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true + } + }, "scripts": { - "analyze": "phpstan analyze", + "analyze": [ + "phpstan analyze", + "psalm" + ], "ci": [ "Composer\\Config::disableProcessTimeout", "@deduplicate", "@analyze", "@test", "@inspect", + "rector process", "@style" ], "deduplicate": "phpcpd app/ src/", From c22033ea798e46b8805f4821d1b8f81a881a4d28 Mon Sep 17 00:00:00 2001 From: MGatner Date: Wed, 22 Jun 2022 13:21:53 +0000 Subject: [PATCH 13/58] Switch to DevKit --- .github/workflows/phpcsfixer.yml | 60 ++++++++++++++++ .github/workflows/psalm.yml | 71 ++++++++++++++++++ .github/workflows/rector.yml | 67 +++++++++++++++++ .php-cs-fixer.dist.php | 5 +- composer-unused.php | 17 +++++ composer.json | 10 +-- deptrac.yaml | 4 +- infection.json.dist | 19 +++++ phpstan.neon.dist | 15 ++-- phpunit.xml.dist | 16 +++-- psalm.xml | 18 +++++ psalm_autoload.php | 20 ++++++ rector.php | 120 +++++++++++++++++++++++++++++++ 13 files changed, 420 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/phpcsfixer.yml create mode 100644 .github/workflows/psalm.yml create mode 100644 .github/workflows/rector.yml create mode 100644 composer-unused.php create mode 100644 infection.json.dist create mode 100644 psalm.xml create mode 100644 psalm_autoload.php create mode 100644 rector.php diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml new file mode 100644 index 0000000..06d6453 --- /dev/null +++ b/.github/workflows/phpcsfixer.yml @@ -0,0 +1,60 @@ +name: PHPCSFixer + +on: + pull_request: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcsfixer.yml' + push: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcsfixer.yml' + +jobs: + build: + name: PHP ${{ matrix.php-versions }} Coding Standards + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + strategy: + fail-fast: false + matrix: + php-versions: ['7.4', '8.0', '8.1'] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: json, tokenizer + coverage: none + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi + + - name: Check code for standards compliance + run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml new file mode 100644 index 0000000..a56ed92 --- /dev/null +++ b/.github/workflows/psalm.yml @@ -0,0 +1,71 @@ +name: Psalm + +on: + pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'psalm*' + - '.github/workflows/psalm.yml' + push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'psalm*' + - '.github/workflows/psalm.yml' + +jobs: + build: + name: Psalm Analysis + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + tools: phpstan, phpunit + extensions: intl, json, mbstring, xml + coverage: none + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Create Psalm cache directory + run: mkdir -p build/psalm + + - name: Cache Psalm results + uses: actions/cache@v3 + with: + path: build/psalm + key: ${{ runner.os }}-psalm-${{ github.sha }} + restore-keys: ${{ runner.os }}-psalm- + + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi + + - name: Run Psalm analysis + run: vendor/bin/psalm diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml new file mode 100644 index 0000000..a945743 --- /dev/null +++ b/.github/workflows/rector.yml @@ -0,0 +1,67 @@ +name: Rector + +on: + pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'rector.php' + - '.github/workflows/rector.yml' + push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'rector.php' + - '.github/workflows/rector.yml' + +jobs: + build: + name: PHP ${{ matrix.php-versions }} Rector Analysis + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + strategy: + fail-fast: false + matrix: + php-versions: ['7.4', '8.0', '8.1'] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: phpstan + extensions: intl, json, mbstring, xml + coverage: none + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi + + - name: Analyze for refactoring + run: | + composer global require --dev rector/rector:^0.12.16 + rector process --dry-run --no-progress-bar diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index dfa45af..1185b9c 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -6,7 +6,10 @@ $finder = Finder::create() ->files() - ->in(__DIR__) + ->in([ + __DIR__ . '/src/', + __DIR__ . '/tests/', + ]) ->exclude('build') ->append([__FILE__]); diff --git a/composer-unused.php b/composer-unused.php new file mode 100644 index 0000000..f46e293 --- /dev/null +++ b/composer-unused.php @@ -0,0 +1,17 @@ +addNamedFilter(NamedFilter::fromString('symfony/config')) + // ->addPatternFilter(PatternFilter::fromString('/symfony-.*/')) + ->setAdditionalFilesFor('codeigniter4/framework', [ + ...Glob::glob(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers/*.php'), + ]); +}; diff --git a/composer.json b/composer.json index 013b072..8629fdc 100644 --- a/composer.json +++ b/composer.json @@ -28,14 +28,8 @@ }, "require-dev": { "cache/integration-tests": "^0.17.0", - "codeigniter/coding-standard": "^1.1", - "codeigniter4/framework": "^4.1", - "nexusphp/cs-config": "^3.1", - "nexusphp/tachycardia": "^1.0", - "php-coveralls/php-coveralls": "^2.4", - "phpstan/phpstan": "^1.0", - "phpunit/phpunit": "^9.5", - "roave/security-advisories": "dev-latest" + "codeigniter4/devkit": "^1.0", + "codeigniter4/framework": "^4.1" }, "provide": { "psr/cache-implementation": "^1.0", diff --git a/deptrac.yaml b/deptrac.yaml index bac0b93..ea116b1 100644 --- a/deptrac.yaml +++ b/deptrac.yaml @@ -1,7 +1,7 @@ parameters: paths: - - ./src - - ./vendor/codeigniter4/codeigniter4/system + - ./src/ + - ./vendor/codeigniter4/framework/system/ exclude_files: - '#.*test.*#i' layers: diff --git a/infection.json.dist b/infection.json.dist new file mode 100644 index 0000000..7badcc6 --- /dev/null +++ b/infection.json.dist @@ -0,0 +1,19 @@ +{ + "source": { + "directories": [ + "src/" + ], + "excludes": [ + "Config", + "Database/Migrations", + "Views" + ] + }, + "logs": { + "text": "build/infection.log" + }, + "mutators": { + "@default": true + }, + "bootstrap": "vendor/codeigniter4/framework/system/Test/bootstrap.php" +} diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a1909d9..5768aec 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,14 +2,21 @@ parameters: tmpDir: build/phpstan level: 5 paths: - - src - - tests + - src/ + - tests/ bootstrapFiles: - - vendor/codeigniter4/codeigniter4/system/Test/bootstrap.php + - vendor/codeigniter4/framework/system/Test/bootstrap.php + excludePaths: + - src/Config/Routes.php + - src/Views/* ignoreErrors: - '#Result of \|\| is always true#' + universalObjectCratesClasses: + - CodeIgniter\Entity + - CodeIgniter\Entity\Entity + - Faker\Generator scanDirectories: - - vendor/codeigniter4/codeigniter4/system/Helpers + - vendor/codeigniter4/framework/system/Helpers dynamicConstantNames: - APP_NAMESPACE - CI_DEBUG diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d8dc74e..2b66e1a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ - ./src + ./src/ + ./src/Config + ./src/Views @@ -35,7 +37,7 @@ - + ./tests @@ -72,16 +74,16 @@ - + - + - + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..386f4dc --- /dev/null +++ b/psalm.xml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/psalm_autoload.php b/psalm_autoload.php new file mode 100644 index 0000000..5a25347 --- /dev/null +++ b/psalm_autoload.php @@ -0,0 +1,20 @@ +sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitSetList::PHPUNIT_80]); + $rectorConfig->parallel(); + // The paths to refactor (can also be supplied with CLI arguments) + $rectorConfig->paths([ + __DIR__ . '/src/', + __DIR__ . '/tests/', + ]); + + // Include Composer's autoload - required for global execution, remove if running locally + $rectorConfig->autoloadPaths([ + __DIR__ . '/vendor/autoload.php', + ]); + + // Do you need to include constants, class aliases, or a custom autoloader? + $rectorConfig->bootstrapFiles([ + realpath(getcwd()) . '/vendor/codeigniter4/framework/system/Test/bootstrap.php', + ]); + + if (is_file(__DIR__ . '/phpstan.neon.dist')) { + $rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon.dist'); + } + + // Set the target version for refactoring + $rectorConfig->phpVersion(PhpVersion::PHP_74); + + // Auto-import fully qualified class names + $rectorConfig->importNames(); + + // Are there files or rules you need to skip? + $rectorConfig->skip([ + __DIR__ . '/src/Views', + + JsonThrowOnErrorRector::class, + StringifyStrNeedlesRector::class, + + // Note: requires php 8 + RemoveUnusedPromotedPropertyRector::class, + + // Ignore tests that might make calls without a result + RemoveEmptyMethodCallRector::class => [ + __DIR__ . '/tests', + ], + + // Ignore files that should not be namespaced + NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [ + __DIR__ . '/src/Helpers', + ], + + // May load view files directly when detecting classes + StringClassNameToClassConstantRector::class, + + // May be uninitialized on purpose + AddDefaultValueForUndefinedVariableRector::class, + ]); + $rectorConfig->rule(SimplifyUselessVariableRector::class); + $rectorConfig->rule(RemoveAlwaysElseRector::class); + $rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class); + $rectorConfig->rule(ForToForeachRector::class); + $rectorConfig->rule(ChangeNestedForeachIfsToEarlyContinueRector::class); + $rectorConfig->rule(ChangeIfElseValueAssignToEarlyReturnRector::class); + $rectorConfig->rule(SimplifyStrposLowerRector::class); + $rectorConfig->rule(CombineIfRector::class); + $rectorConfig->rule(SimplifyIfReturnBoolRector::class); + $rectorConfig->rule(InlineIfToExplicitIfRector::class); + $rectorConfig->rule(PreparedValueToEarlyReturnRector::class); + $rectorConfig->rule(ShortenElseIfRector::class); + $rectorConfig->rule(SimplifyIfElseToTernaryRector::class); + $rectorConfig->rule(UnusedForeachValueToArrayKeysRector::class); + $rectorConfig->rule(ChangeArrayPushToArrayAssignRector::class); + $rectorConfig->rule(UnnecessaryTernaryExpressionRector::class); + $rectorConfig->rule(AddPregQuoteDelimiterRector::class); + $rectorConfig->rule(SimplifyRegexPatternRector::class); + $rectorConfig->rule(FuncGetArgsToVariadicParamRector::class); + $rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class); + $rectorConfig->rule(SimplifyEmptyArrayCheckRector::class); + $rectorConfig->rule(NormalizeNamespaceByPSR4ComposerAutoloadRector::class); + $rectorConfig + ->ruleWithConfiguration(TypedPropertyRector::class, [ + // Set to false if you use in libraries, or it does create breaking changes. + TypedPropertyRector::INLINE_PUBLIC => true, + ]); +}; From 62420c85b86be9130a6281965fe10ded4911f2ef Mon Sep 17 00:00:00 2001 From: MGatner Date: Wed, 22 Jun 2022 13:28:46 +0000 Subject: [PATCH 14/58] Apply Rector suggestions --- phpstan.neon.dist | 1 - src/Item.php | 18 +++--------------- src/Pool.php | 12 +----------- src/SimpleCache.php | 6 +++--- src/SupportTrait.php | 2 +- tests/NonPsrTest.php | 2 +- 6 files changed, 9 insertions(+), 32 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 5768aec..f27f414 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -10,7 +10,6 @@ parameters: - src/Config/Routes.php - src/Views/* ignoreErrors: - - '#Result of \|\| is always true#' universalObjectCratesClasses: - CodeIgniter\Entity - CodeIgniter\Entity\Entity diff --git a/src/Item.php b/src/Item.php index 82f9b7f..7cd2f05 100644 --- a/src/Item.php +++ b/src/Item.php @@ -27,10 +27,7 @@ final class Item implements CacheItemInterface */ public const RESERVED_CHARACTERS = '{}()/\@:'; - /** - * @var string - */ - private $key; + private string $key; /** * @var mixed @@ -40,17 +37,13 @@ final class Item implements CacheItemInterface /** * Whether this Item was the result * of a cache hit. - * - * @var bool */ - private $hit; + private bool $hit; /** * The expiration time - * - * @var Time|null */ - private $expiration; + private ?Time $expiration = null; /** * Validates a cache key according to PSR-6. @@ -87,7 +80,6 @@ public function __construct(string $key, $value, bool $hit) * The key is loaded by the Implementing Library, but should be available to * the higher level callers when needed. * - * @return string * The key string for this cache item. */ public function getKey(): string @@ -118,7 +110,6 @@ public function get() * Note: This method MUST NOT have a race condition between calling isHit() * and calling get(). * - * @return bool * True if the request resulted in a cache hit. False otherwise. */ public function isHit(): bool @@ -136,7 +127,6 @@ public function isHit(): bool * @param mixed $value * The serializable value to be stored. * - * @return static * The invoked object. */ public function set($value): self @@ -155,7 +145,6 @@ public function set($value): self * the value should be stored permanently or for as long as the * implementation allows. * - * @return static * The called object. */ public function expiresAt($expiration): self @@ -181,7 +170,6 @@ public function expiresAt($expiration): self * If none is set, the value should be stored permanently or for as long as the * implementation allows. * - * @return static * The called object. */ public function expiresAfter($time): self diff --git a/src/Pool.php b/src/Pool.php index 16b4f21..f11121d 100644 --- a/src/Pool.php +++ b/src/Pool.php @@ -24,7 +24,7 @@ final class Pool implements CacheItemPoolInterface * * @var array */ - private $deferred = []; + private array $deferred = []; /** * Commits any deferred Items. @@ -47,7 +47,6 @@ public function __destruct() * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException * MUST be thrown. * - * @return CacheItemInterface * The corresponding Cache Item. */ public function getItem($key): CacheItemInterface @@ -87,7 +86,6 @@ public function getItem($key): CacheItemInterface * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException * MUST be thrown. * - * @return array * A traversable collection of Cache Items keyed by the cache keys of * each item. A Cache item will be returned for each key, even if that * key is not found. However, if no keys are specified then an empty @@ -120,7 +118,6 @@ public function getItems(array $keys = []): array * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException * MUST be thrown. * - * @return bool * True if item exists in the cache, false otherwise. */ public function hasItem($key): bool @@ -158,7 +155,6 @@ public function clear() * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException * MUST be thrown. * - * @return bool * True if the item was successfully removed. False if there was an error. */ public function deleteItem($key): bool @@ -189,7 +185,6 @@ public function deleteItem($key): bool * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException * MUST be thrown. * - * @return bool * True if the items were successfully removed. False if there was an error. */ public function deleteItems(array $keys): bool @@ -209,7 +204,6 @@ public function deleteItems(array $keys): bool /** * Persists a cache item immediately. * - * @param CacheItemInterface $item * The cache item to save. * * @return bool @@ -242,10 +236,7 @@ public function save(CacheItemInterface $item) /** * Sets a cache item to be persisted later. * - * @param CacheItemInterface $item * The cache item to save. - * - * @return bool * False if the item could not be queued or if a commit was attempted and failed. True otherwise. */ public function saveDeferred(CacheItemInterface $item): bool @@ -268,7 +259,6 @@ public function saveDeferred(CacheItemInterface $item): bool /** * Persists any deferred cache items. * - * @return bool * True if all not-yet-saved items were successfully saved or there were none. False otherwise. */ public function commit(): bool diff --git a/src/SimpleCache.php b/src/SimpleCache.php index 0cd8bcf..1f8f623 100644 --- a/src/SimpleCache.php +++ b/src/SimpleCache.php @@ -127,7 +127,7 @@ public function clear() */ public function getMultiple($keys, $default = null) { - if (! (is_array($keys) || $keys instanceof Traversable)) { + if (! (is_iterable($keys))) { throw new CacheArgumentException('getMultiple only accepts traversable input.'); } @@ -158,7 +158,7 @@ public function getMultiple($keys, $default = null) */ public function setMultiple($values, $ttl = null) { - if (! (is_array($values) || $values instanceof Traversable)) { + if (! (is_iterable($values))) { throw new CacheArgumentException('setMultiple only accepts traversable input.'); } @@ -190,7 +190,7 @@ public function setMultiple($values, $ttl = null) */ public function deleteMultiple($keys) { - if (! (is_array($keys) || $keys instanceof Traversable)) { + if (! (is_iterable($keys))) { throw new CacheArgumentException('deleteMultiple only accepts traversable input.'); } diff --git a/src/SupportTrait.php b/src/SupportTrait.php index 61d79e0..779445a 100644 --- a/src/SupportTrait.php +++ b/src/SupportTrait.php @@ -47,7 +47,7 @@ public function __construct($object = null) } elseif ($object instanceof CacheInterface) { $this->adapter = $object; } else { - throw new CacheArgumentException(__CLASS__ . ' constructor only accepts an adapter or configuration'); + throw new CacheArgumentException(self::class . ' constructor only accepts an adapter or configuration'); } } } diff --git a/tests/NonPsrTest.php b/tests/NonPsrTest.php index 8e1ffee..635256c 100644 --- a/tests/NonPsrTest.php +++ b/tests/NonPsrTest.php @@ -56,7 +56,7 @@ public function testConstructorThrowsException() $this->expectException(CacheArgumentException::class); $this->expectExceptionMessage('CodeIgniter\Psr\Cache\SimpleCache constructor only accepts an adapter or configuration'); - $psr = new SimpleCache(42); // @phpstan-ignore-line + new SimpleCache(42); // @phpstan-ignore-line } //-------------------------------------------------------------------- From b5cddcf85da1635d88a0104f624077844c13db5d Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean <97607754+ddevsr@users.noreply.github.com> Date: Thu, 21 Jul 2022 09:16:34 +0700 Subject: [PATCH 15/58] fix: typo sample namespace --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c89a50..ad2849b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ is only for integrating third-party packages that rely on the PSR interface prov 2. Integrate with your favorite packages: ```php -use CodeIgniter\Psr\Cache\SimeplCache; +use CodeIgniter\Psr\Cache\SimpleCache; use Kreait\Firebase\Factory; ... From d134ebc861e11850cdb24475417ef8c647f610bc Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 9 Sep 2022 15:39:04 +0900 Subject: [PATCH 16/58] 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 fdd85599eb68ca4562bbc5faef9e659ae19751cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 12:30:36 +0000 Subject: [PATCH 17/58] chore(deps): bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/compare.yml | 2 +- .github/workflows/deptrac.yml | 2 +- .github/workflows/phpcpd.yml | 2 +- .github/workflows/phpcsfixer.yml | 2 +- .github/workflows/phpstan.yml | 2 +- .github/workflows/phpunit.yml | 2 +- .github/workflows/psalm.yml | 2 +- .github/workflows/rector.yml | 2 +- .github/workflows/unused.yml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml index 9897358..0975d47 100644 --- a/.github/workflows/compare.yml +++ b/.github/workflows/compare.yml @@ -14,7 +14,7 @@ jobs: name: Compare for Backwards Compatibility runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/deptrac.yml b/.github/workflows/deptrac.yml index 441c74d..56da892 100644 --- a/.github/workflows/deptrac.yml +++ b/.github/workflows/deptrac.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/phpcpd.yml b/.github/workflows/phpcpd.yml index d6a877d..9fe6d9e 100644 --- a/.github/workflows/phpcpd.yml +++ b/.github/workflows/phpcpd.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index 06d6453..f3794b5 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 6bdd00f..8c59f23 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index c875e33..248eb0c 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index a56ed92..7f58acd 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index a945743..0038deb 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml index b02fab6..8a72bc2 100644 --- a/.github/workflows/unused.yml +++ b/.github/workflows/unused.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 From ca38aff85e0baad4746aa134d25da94eb1a4ca5d Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 7 Sep 2023 10:57:36 +0900 Subject: [PATCH 18/58] chore: reuse github workflows --- .github/workflows/deptrac.yml | 68 +------------------------ .github/workflows/phpcpd.yml | 33 ++----------- .github/workflows/phpcsfixer.yml | 55 +-------------------- .github/workflows/phpstan.yml | 70 +------------------------- .github/workflows/phpunit.yml | 85 +------------------------------- .github/workflows/psalm.yml | 66 +------------------------ .github/workflows/rector.yml | 62 +---------------------- .github/workflows/unused.yml | 54 +------------------- 8 files changed, 18 insertions(+), 475 deletions(-) diff --git a/.github/workflows/deptrac.yml b/.github/workflows/deptrac.yml index 56da892..0de9b55 100644 --- a/.github/workflows/deptrac.yml +++ b/.github/workflows/deptrac.yml @@ -2,72 +2,8 @@ name: Deptrac on: pull_request: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'depfile.yaml' - - '.github/workflows/deptrac.yml' push: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'depfile.yaml' - - '.github/workflows/deptrac.yml' jobs: - build: - name: Dependency Tracing - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - tools: phive - extensions: intl, json, mbstring, xml - coverage: none - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Create Deptrac cache directory - run: mkdir -p build/ - - - name: Cache Deptrac results - uses: actions/cache@v3 - with: - path: build - key: ${{ runner.os }}-deptrac-${{ github.sha }} - restore-keys: ${{ runner.os }}-deptrac- - - - name: Install dependencies - run: | - if [ -f composer.lock ]; then - composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader - else - composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - fi - - - name: Trace dependencies - run: | - sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac - deptrac analyze --cache-file=build/deptrac.cache + deptrac: + uses: codeigniter4/.github/.github/workflows/deptrac.yml@main diff --git a/.github/workflows/phpcpd.yml b/.github/workflows/phpcpd.yml index 9fe6d9e..a63f978 100644 --- a/.github/workflows/phpcpd.yml +++ b/.github/workflows/phpcpd.yml @@ -2,35 +2,10 @@ name: PHPCPD on: pull_request: - branches: - - develop - paths: - - '**.php' - - '.github/workflows/phpcpd.yml' push: - branches: - - develop - paths: - - '**.php' - - '.github/workflows/phpcpd.yml' jobs: - build: - name: Code Copy-Paste Detection - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - tools: phpcpd - extensions: dom, mbstring - coverage: none - - - name: Detect duplicate code - run: phpcpd src/ tests/ + phpcpd: + uses: codeigniter4/.github/.github/workflows/phpcpd.yml@main + with: + dirs: "src/ tests/" diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index f3794b5..84cbc39 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -2,59 +2,8 @@ name: PHPCSFixer on: pull_request: - branches: - - develop - paths: - - '**.php' - - '.github/workflows/phpcsfixer.yml' push: - branches: - - develop - paths: - - '**.php' - - '.github/workflows/phpcsfixer.yml' jobs: - build: - name: PHP ${{ matrix.php-versions }} Coding Standards - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - strategy: - fail-fast: false - matrix: - php-versions: ['7.4', '8.0', '8.1'] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: json, tokenizer - coverage: none - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install dependencies - run: | - if [ -f composer.lock ]; then - composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader - else - composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - fi - - - name: Check code for standards compliance - run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff + phpcsfixer: + uses: codeigniter4/.github/.github/workflows/phpcsfixer.yml@main diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 8c59f23..fabe558 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -2,74 +2,8 @@ name: PHPStan on: pull_request: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'phpstan*' - - '.github/workflows/phpstan.yml' push: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'phpstan*' - - '.github/workflows/phpstan.yml' jobs: - build: - name: PHP ${{ matrix.php-versions }} Static Analysis - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - strategy: - fail-fast: false - matrix: - php-versions: ['7.4', '8.0', '8.1'] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - tools: phpstan, phpunit - extensions: intl, json, mbstring, xml - coverage: none - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Create PHPStan cache directory - run: mkdir -p build/phpstan - - - name: Cache PHPStan results - uses: actions/cache@v3 - with: - path: build/phpstan - key: ${{ runner.os }}-phpstan-${{ github.sha }} - restore-keys: ${{ runner.os }}-phpstan- - - - name: Install dependencies - run: | - if [ -f composer.lock ]; then - composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader - else - composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - fi - - - name: Run static analysis - run: vendor/bin/phpstan analyze + phpstan: + uses: codeigniter4/.github/.github/workflows/phpstan.yml@main diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 248eb0c..3d476af 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -2,89 +2,8 @@ name: PHPUnit on: pull_request: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'phpunit*' - - '.github/workflows/phpunit.yml' push: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'phpunit*' - - '.github/workflows/phpunit.yml' jobs: - main: - name: PHP ${{ matrix.php-versions }} Unit Tests - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - strategy: - matrix: - php-versions: ['7.4', '8.0', '8.1'] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - tools: composer, phive, phpunit - extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3 - coverage: xdebug - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install dependencies - run: | - if [ -f composer.lock ]; then - composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader - else - composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - fi - - - name: Test with PHPUnit - run: vendor/bin/phpunit --verbose --coverage-text - env: - TERM: xterm-256color - TACHYCARDIA_MONITOR_GA: enabled - - - if: matrix.php-versions == '8.0' - name: Run Coveralls - continue-on-error: true - run: | - sudo phive --no-progress install --global --trust-gpg-keys E82B2FB314E9906E php-coveralls - php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_PARALLEL: true - COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }} - - coveralls: - needs: [main] - name: Coveralls Finished - runs-on: ubuntu-latest - steps: - - name: Upload Coveralls results - uses: coverallsapp/github-action@master - continue-on-error: true - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true + phpunit: + uses: codeigniter4/.github/.github/workflows/phpunit.yml@main diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 7f58acd..4722444 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -2,70 +2,8 @@ name: Psalm on: pull_request: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'psalm*' - - '.github/workflows/psalm.yml' push: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'psalm*' - - '.github/workflows/psalm.yml' jobs: - build: - name: Psalm Analysis - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - tools: phpstan, phpunit - extensions: intl, json, mbstring, xml - coverage: none - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Create Psalm cache directory - run: mkdir -p build/psalm - - - name: Cache Psalm results - uses: actions/cache@v3 - with: - path: build/psalm - key: ${{ runner.os }}-psalm-${{ github.sha }} - restore-keys: ${{ runner.os }}-psalm- - - - name: Install dependencies - run: | - if [ -f composer.lock ]; then - composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader - else - composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - fi - - - name: Run Psalm analysis - run: vendor/bin/psalm + psalm: + uses: codeigniter4/.github/.github/workflows/psalm.yml@main diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 0038deb..88eec78 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -2,66 +2,8 @@ name: Rector on: pull_request: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'rector.php' - - '.github/workflows/rector.yml' push: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - 'rector.php' - - '.github/workflows/rector.yml' jobs: - build: - name: PHP ${{ matrix.php-versions }} Rector Analysis - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - strategy: - fail-fast: false - matrix: - php-versions: ['7.4', '8.0', '8.1'] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - tools: phpstan - extensions: intl, json, mbstring, xml - coverage: none - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install dependencies - run: | - if [ -f composer.lock ]; then - composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader - else - composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - fi - - - name: Analyze for refactoring - run: | - composer global require --dev rector/rector:^0.12.16 - rector process --dry-run --no-progress-bar + rector: + uses: codeigniter4/.github/.github/workflows/rector.yml@main diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml index 8a72bc2..13b155c 100644 --- a/.github/workflows/unused.yml +++ b/.github/workflows/unused.yml @@ -2,58 +2,8 @@ name: Unused on: pull_request: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - '.github/workflows/unused.yml' push: - branches: - - develop - paths: - - '**.php' - - 'composer.*' - - '.github/workflows/unused.yml' jobs: - build: - name: Unused Package Detection - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - tools: composer, composer-unused - extensions: intl, json, mbstring, xml - coverage: none - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install dependencies - run: | - if [ -f composer.lock ]; then - composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader - else - composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - fi - - - name: Detect unused packages - run: composer-unused -vvv --output-format=github --ansi --no-interaction --no-progress + unused: + uses: codeigniter4/.github/.github/workflows/unused.yml@main From acbf9355f8c7068526343f2fd18fa38f57e1789e Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 7 Sep 2023 11:01:06 +0900 Subject: [PATCH 19/58] style: composer style --- src/SimpleCache.php | 28 ++++++++++++++-------------- tests/NonPsrTest.php | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/SimpleCache.php b/src/SimpleCache.php index 1f8f623..4bad283 100644 --- a/src/SimpleCache.php +++ b/src/SimpleCache.php @@ -25,10 +25,10 @@ final class SimpleCache implements CacheInterface * @param string $key The unique key of this item in the cache. * @param mixed $default Default value to return if the key does not exist. * + * @return mixed The value of the item from the cache, or $default in case of cache miss. + * * @throws CacheArgumentException * MUST be thrown if the $key string is not a legal value. - * - * @return mixed The value of the item from the cache, or $default in case of cache miss. */ public function get($key, $default = null) { @@ -53,10 +53,10 @@ public function get($key, $default = null) * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * + * @return bool True on success and false on failure. + * * @throws CacheArgumentException * MUST be thrown if the $key string is not a legal value. - * - * @return bool True on success and false on failure. */ public function set($key, $value, $ttl = null) { @@ -86,10 +86,10 @@ public function set($key, $value, $ttl = null) * * @param string $key The unique cache key of the item to delete. * + * @return bool True if the item was successfully removed. False if there was an error. + * * @throws CacheArgumentException * MUST be thrown if the $key string is not a legal value. - * - * @return bool True if the item was successfully removed. False if there was an error. */ public function delete($key) { @@ -119,11 +119,11 @@ public function clear() * @param iterable $keys A list of keys that can obtained in a single operation. * @param mixed $default Default value to return for keys that do not exist. * + * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. + * * @throws CacheArgumentException * MUST be thrown if $keys is neither an array nor a Traversable, * or if any of the $keys are not a legal value. - * - * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. */ public function getMultiple($keys, $default = null) { @@ -150,11 +150,11 @@ public function getMultiple($keys, $default = null) * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * + * @return bool True on success and false on failure. + * * @throws CacheArgumentException * MUST be thrown if $values is neither an array nor a Traversable, * or if any of the $values are not a legal value. - * - * @return bool True on success and false on failure. */ public function setMultiple($values, $ttl = null) { @@ -182,11 +182,11 @@ public function setMultiple($values, $ttl = null) * * @param iterable $keys A list of string-based keys to be deleted. * + * @return bool True if the items were successfully removed. False if there was an error. + * * @throws CacheArgumentException * MUST be thrown if $keys is neither an array nor a Traversable, * or if any of the $keys are not a legal value. - * - * @return bool True if the items were successfully removed. False if there was an error. */ public function deleteMultiple($keys) { @@ -216,10 +216,10 @@ public function deleteMultiple($keys) * * @param string $key The cache item key. * + * @return bool + * * @throws CacheArgumentException * MUST be thrown if the $key string is not a legal value. - * - * @return bool */ public function has($key) { diff --git a/tests/NonPsrTest.php b/tests/NonPsrTest.php index 635256c..9d4c3ef 100644 --- a/tests/NonPsrTest.php +++ b/tests/NonPsrTest.php @@ -59,7 +59,7 @@ public function testConstructorThrowsException() new SimpleCache(42); // @phpstan-ignore-line } - //-------------------------------------------------------------------- + // -------------------------------------------------------------------- public function testItemExpiresAtThrowsException() { From 170ece654012806a243012f66ab27e3bd1071949 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 7 Sep 2023 11:31:08 +0900 Subject: [PATCH 20/58] chore: update compare.yml "running the tool in github action without docker is also twice as fast" See https://github.com/Nyholm/roave-bc-check-docker/issues/32#issuecomment-1488315665 --- .github/workflows/compare.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml index 0975d47..ac49fe5 100644 --- a/.github/workflows/compare.yml +++ b/.github/workflows/compare.yml @@ -18,12 +18,20 @@ jobs: with: fetch-depth: 0 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Install roave/backward-compatibility-check. + run: composer require --dev roave/backward-compatibility-check + - name: Run comparison (limited) if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - uses: docker://nyholm/roave-bc-check-ga + run: vendor/bin/roave-backward-compatibility-check - name: Run comparison (authenticated) if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - uses: docker://nyholm/roave-bc-check-ga + run: vendor/bin/roave-backward-compatibility-check env: COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} From 39e574189538b4383f671d55c409aefef50a04fc Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 7 Sep 2023 11:35:08 +0900 Subject: [PATCH 21/58] chore: add rector 0.18.2 --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8629fdc..d963169 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,8 @@ "require-dev": { "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", - "codeigniter4/framework": "^4.1" + "codeigniter4/framework": "^4.1", + "rector/rector": "0.18.2" }, "provide": { "psr/cache-implementation": "^1.0", From e04d0a4fe29a728564704da7d140f3a4a58f50c5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 7 Sep 2023 11:55:56 +0900 Subject: [PATCH 22/58] chore: update php-cs-fixer.dist.php from devkit --- .php-cs-fixer.dist.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 1185b9c..a0a7091 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -10,10 +10,19 @@ __DIR__ . '/src/', __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, From 41c9c98f1e424b4cec2e82f9f2ce876fc10ffc0a Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 7 Sep 2023 11:58:48 +0900 Subject: [PATCH 23/58] chore: update rector.php --- rector.php | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/rector.php b/rector.php index db41b05..21c4c40 100644 --- a/rector.php +++ b/rector.php @@ -1,11 +1,8 @@ sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitSetList::PHPUNIT_80]); @@ -74,26 +69,12 @@ // Note: requires php 8 RemoveUnusedPromotedPropertyRector::class, - // Ignore tests that might make calls without a result - RemoveEmptyMethodCallRector::class => [ - __DIR__ . '/tests', - ], - - // Ignore files that should not be namespaced - NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [ - __DIR__ . '/src/Helpers', - ], - // May load view files directly when detecting classes StringClassNameToClassConstantRector::class, - - // May be uninitialized on purpose - AddDefaultValueForUndefinedVariableRector::class, ]); $rectorConfig->rule(SimplifyUselessVariableRector::class); $rectorConfig->rule(RemoveAlwaysElseRector::class); $rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class); - $rectorConfig->rule(ForToForeachRector::class); $rectorConfig->rule(ChangeNestedForeachIfsToEarlyContinueRector::class); $rectorConfig->rule(ChangeIfElseValueAssignToEarlyReturnRector::class); $rectorConfig->rule(SimplifyStrposLowerRector::class); @@ -106,15 +87,13 @@ $rectorConfig->rule(UnusedForeachValueToArrayKeysRector::class); $rectorConfig->rule(ChangeArrayPushToArrayAssignRector::class); $rectorConfig->rule(UnnecessaryTernaryExpressionRector::class); - $rectorConfig->rule(AddPregQuoteDelimiterRector::class); $rectorConfig->rule(SimplifyRegexPatternRector::class); $rectorConfig->rule(FuncGetArgsToVariadicParamRector::class); $rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class); $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 19f5559493bdfa8b2dc38bdda163988bb2d1857a Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 10 Sep 2023 05:41:48 +0900 Subject: [PATCH 24/58] chore: add GITHUB_TOKEN --- .github/workflows/compare.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml index ac49fe5..b56460c 100644 --- a/.github/workflows/compare.yml +++ b/.github/workflows/compare.yml @@ -22,6 +22,8 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install roave/backward-compatibility-check. run: composer require --dev roave/backward-compatibility-check From b5541da2cea613151d49d9dc0f86292efe416f03 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 12 Sep 2023 15:16:49 +0900 Subject: [PATCH 25/58] chore: fix workflow on section --- .github/workflows/deptrac.yml | 14 ++++++++++++++ .github/workflows/phpcpd.yml | 10 ++++++++++ .github/workflows/phpcsfixer.yml | 10 ++++++++++ .github/workflows/phpstan.yml | 14 ++++++++++++++ .github/workflows/phpunit.yml | 14 ++++++++++++++ .github/workflows/psalm.yml | 14 ++++++++++++++ .github/workflows/rector.yml | 14 ++++++++++++++ .github/workflows/unused.yml | 12 ++++++++++++ 8 files changed, 102 insertions(+) diff --git a/.github/workflows/deptrac.yml b/.github/workflows/deptrac.yml index 0de9b55..ebaf4df 100644 --- a/.github/workflows/deptrac.yml +++ b/.github/workflows/deptrac.yml @@ -2,7 +2,21 @@ name: Deptrac on: pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'depfile.yaml' + - '.github/workflows/deptrac.yml' push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'depfile.yaml' + - '.github/workflows/deptrac.yml' jobs: deptrac: diff --git a/.github/workflows/phpcpd.yml b/.github/workflows/phpcpd.yml index a63f978..8ef9e2f 100644 --- a/.github/workflows/phpcpd.yml +++ b/.github/workflows/phpcpd.yml @@ -2,7 +2,17 @@ name: PHPCPD on: pull_request: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcpd.yml' push: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcpd.yml' jobs: phpcpd: diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index 84cbc39..ee1221a 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -2,7 +2,17 @@ name: PHPCSFixer on: pull_request: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcsfixer.yml' push: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcsfixer.yml' jobs: phpcsfixer: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index fabe558..58e2add 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -2,7 +2,21 @@ name: PHPStan on: pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'phpstan*' + - '.github/workflows/phpstan.yml' push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'phpstan*' + - '.github/workflows/phpstan.yml' jobs: phpstan: diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 3d476af..9bcd5ec 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -2,7 +2,21 @@ name: PHPUnit on: pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'phpunit*' + - '.github/workflows/phpunit.yml' push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'phpunit*' + - '.github/workflows/phpunit.yml' jobs: phpunit: diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 4722444..53c76e7 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -2,7 +2,21 @@ name: Psalm on: pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'psalm*' + - '.github/workflows/psalm.yml' push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'psalm*' + - '.github/workflows/psalm.yml' jobs: psalm: diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 88eec78..8c19b16 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -2,7 +2,21 @@ name: Rector on: pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'rector.php' + - '.github/workflows/rector.yml' push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - 'rector.php' + - '.github/workflows/rector.yml' jobs: rector: diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml index 13b155c..1758dda 100644 --- a/.github/workflows/unused.yml +++ b/.github/workflows/unused.yml @@ -2,7 +2,19 @@ name: Unused on: pull_request: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - '.github/workflows/unused.yml' push: + branches: + - develop + paths: + - '**.php' + - 'composer.*' + - '.github/workflows/unused.yml' jobs: unused: From f70deca0a8bbb0387db808c8b7e12e3015d9f1f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:20:08 +0000 Subject: [PATCH 26/58] chore(deps-dev): update rector/rector requirement from 0.18.2 to 0.18.3 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.18.2...0.18.3) --- 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 d963169..747bc21 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.18.2" + "rector/rector": "0.18.3" }, "provide": { "psr/cache-implementation": "^1.0", From 8a39825a782cc3cfb50afad4cc7853128c68139b Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 20 Sep 2023 10:08:13 +0900 Subject: [PATCH 27/58] chore: fix phpunit.yml Fix the workflow does not work because of wrong testsuite name. Use phpunit-no-db.yml. --- .github/workflows/phpunit.yml | 2 +- phpunit.xml.dist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 9bcd5ec..d6a7085 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -20,4 +20,4 @@ on: jobs: phpunit: - uses: codeigniter4/.github/.github/workflows/phpunit.yml@main + uses: codeigniter4/.github/.github/workflows/phpunit-no-db.yml@main diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2b66e1a..ac88cfc 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -37,7 +37,7 @@ - + ./tests From 5af01338aeb098a1dad61a7d074b49b621d7ebff Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 7 Sep 2023 14:51:45 +0900 Subject: [PATCH 28/58] chore: update composer.scripts --- composer.json | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 747bc21..4197bce 100644 --- a/composer.json +++ b/composer.json @@ -58,21 +58,25 @@ }, "scripts": { "analyze": [ + "Composer\\Config::disableProcessTimeout", "phpstan analyze", - "psalm" + "psalm", + "rector process --dry-run" ], + "sa": "@analyze", "ci": [ "Composer\\Config::disableProcessTimeout", + "@cs", "@deduplicate", - "@analyze", - "@test", "@inspect", - "rector process", - "@style" + "@analyze", + "@test" ], - "deduplicate": "phpcpd app/ src/", + "cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff", + "cs-fix": "php-cs-fixer fix --ansi --verbose --diff --using-cache=yes", + "style": "@cs-fix", + "deduplicate": "phpcpd src/ tests/", "inspect": "deptrac analyze --cache-file=build/deptrac.cache", - "style": "php-cs-fixer fix --verbose --ansi --using-cache=no", "test": "phpunit" } } From 1c4339326cfb9d65cffb2cc087463e186541f95e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:50:01 +0000 Subject: [PATCH 29/58] chore(deps-dev): update rector/rector requirement from 0.18.3 to 0.18.4 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.18.3...0.18.4) --- 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 747bc21..5b88a36 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.18.3" + "rector/rector": "0.18.4" }, "provide": { "psr/cache-implementation": "^1.0", From 2f3ef9f68bbca3c0bb76eeb699f408e8d0d25dee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:06:17 +0000 Subject: [PATCH 30/58] chore(deps-dev): update rector/rector requirement from 0.18.4 to 0.18.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.18.4...0.18.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 2072592..5b310f7 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.18.4" + "rector/rector": "0.18.5" }, "provide": { "psr/cache-implementation": "^1.0", From b3360efc2b3d66fb7bc3986176a6115d7c0885b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:36:36 +0000 Subject: [PATCH 31/58] chore(deps-dev): update rector/rector requirement from 0.18.5 to 0.18.10 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.18.5...0.18.10) --- 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 5b310f7..849650d 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.18.5" + "rector/rector": "0.18.10" }, "provide": { "psr/cache-implementation": "^1.0", From cc09269f44ff2859b8ab2fc0866945f7f8549dcb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 12:16:21 +0000 Subject: [PATCH 32/58] chore(deps-dev): update rector/rector requirement 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.18.10...0.18.11) --- 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 849650d..a1ae21d 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.18.10" + "rector/rector": "0.18.11" }, "provide": { "psr/cache-implementation": "^1.0", From 3246fcd6e36383968825d7f19dc84ea10240aed4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 12:44:44 +0000 Subject: [PATCH 33/58] chore(deps-dev): update rector/rector requirement 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.18.11...0.18.12) --- 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 a1ae21d..cdeae3e 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.18.11" + "rector/rector": "0.18.12" }, "provide": { "psr/cache-implementation": "^1.0", From 3bf962cf7bf5a9787b24b8e1a4f72b423494d30a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 12:29:11 +0000 Subject: [PATCH 34/58] chore(deps-dev): update rector/rector requirement 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.18.12...0.18.13) --- 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 cdeae3e..93bc8f2 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.18.12" + "rector/rector": "0.18.13" }, "provide": { "psr/cache-implementation": "^1.0", From 7215e1a933d56fd8101214d37b1b660c2205c303 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 12:29:54 +0000 Subject: [PATCH 35/58] chore(deps-dev): update rector/rector requirement from 0.18.13 to 0.19.2 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.18.13...0.19.2) --- 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 93bc8f2..fc34485 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.18.13" + "rector/rector": "0.19.2" }, "provide": { "psr/cache-implementation": "^1.0", From 00c45dba764baef7819e7aeab98eb0f5ff0d0ea5 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 22 Jan 2024 19:36:37 +0700 Subject: [PATCH 36/58] Update rector.php --- rector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rector.php b/rector.php index 21c4c40..cbd58a1 100644 --- a/rector.php +++ b/rector.php @@ -16,7 +16,6 @@ use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector; use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; use Rector\Config\RectorConfig; -use Rector\Core\ValueObject\PhpVersion; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector; use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector; use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector; @@ -29,6 +28,7 @@ use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; +use Rector\ValueObject\PhpVersion; return static function (RectorConfig $rectorConfig): void { $rectorConfig->sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitSetList::PHPUNIT_80]); From bc39082ec7b3266550130789a7d3de539486a404 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 12:41:43 +0000 Subject: [PATCH 37/58] chore(deps-dev): update rector/rector requirement from 0.19.2 to 0.19.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.19.2...0.19.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 fc34485..f7f4df0 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.19.2" + "rector/rector": "0.19.5" }, "provide": { "psr/cache-implementation": "^1.0", From e010b1763976af2b5071789889188f62a01db572 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:03:47 +0000 Subject: [PATCH 38/58] chore(deps-dev): update rector/rector requirement from 0.19.5 to 0.19.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.19.5...0.19.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 f7f4df0..e928bc1 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.19.5" + "rector/rector": "0.19.8" }, "provide": { "psr/cache-implementation": "^1.0", From 5b82298d1fb6e2731f90fd88a8833143780f66d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 12:32:54 +0000 Subject: [PATCH 39/58] chore(deps-dev): update rector/rector requirement from 0.19.8 to 1.0.1 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.19.8...1.0.1) --- 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 e928bc1..1cefd3a 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "0.19.8" + "rector/rector": "1.0.1" }, "provide": { "psr/cache-implementation": "^1.0", From cdf1bf63de5507e623b06d30c8f42019cd0e721a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:31:50 +0000 Subject: [PATCH 40/58] chore(deps-dev): update rector/rector requirement from 1.0.1 to 1.0.2 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/1.0.1...1.0.2) --- 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 1cefd3a..de4a80a 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "1.0.1" + "rector/rector": "1.0.2" }, "provide": { "psr/cache-implementation": "^1.0", From ebffbd97bbbe8c4c326c0376d75b5fbcfc35c331 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:23:29 +0000 Subject: [PATCH 41/58] chore(deps-dev): update rector/rector requirement from 1.0.2 to 1.0.3 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/1.0.2...1.0.3) --- 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 de4a80a..66c660c 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "1.0.2" + "rector/rector": "1.0.3" }, "provide": { "psr/cache-implementation": "^1.0", From 1dec20b3b9c54655e2d83a07b4384d5762714f65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 12:45:42 +0000 Subject: [PATCH 42/58] chore(deps-dev): update rector/rector requirement from 1.0.3 to 1.0.4 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/1.0.3...1.0.4) --- 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 66c660c..052c9ba 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "1.0.3" + "rector/rector": "1.0.4" }, "provide": { "psr/cache-implementation": "^1.0", From b3d3e55b5a1632c821cdce65fc145779df1ce006 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 12:47:54 +0000 Subject: [PATCH 43/58] chore(deps-dev): update rector/rector requirement from 1.0.4 to 1.0.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/1.0.4...1.0.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 052c9ba..b48197c 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "1.0.4" + "rector/rector": "1.0.5" }, "provide": { "psr/cache-implementation": "^1.0", From 3e9d2da38c93fd6469c549f23634f4b6c7a5711f Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 11 May 2024 09:42:24 +0900 Subject: [PATCH 44/58] chore: update psalm_autoload.php --- psalm_autoload.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/psalm_autoload.php b/psalm_autoload.php index 5a25347..d1fab7d 100644 --- a/psalm_autoload.php +++ b/psalm_autoload.php @@ -10,6 +10,10 @@ foreach ($helperDirs as $dir) { $dir = __DIR__ . '/' . $dir; + if (! is_dir($dir)) { + continue; + } + chdir($dir); foreach (glob('*_helper.php') as $filename) { @@ -18,3 +22,5 @@ require_once $filePath; } } + +chdir(__DIR__); From ba9f259fdef29728a33b849f6eaf12b36f3e42c2 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 11 May 2024 09:42:38 +0900 Subject: [PATCH 45/58] chore: update psalm.xml If the Target PHP version is 7.4, UndefinedFunction errors occur. --- psalm.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/psalm.xml b/psalm.xml index 386f4dc..976c974 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,5 +1,6 @@ From 6eae7977aefb25a5fcafae9a0511675bd57e0645 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 11 May 2024 09:49:36 +0900 Subject: [PATCH 46/58] sytle: composer cs-fix --- src/Pool.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Pool.php b/src/Pool.php index f11121d..2c1b652 100644 --- a/src/Pool.php +++ b/src/Pool.php @@ -79,8 +79,8 @@ public function getItem($key): CacheItemInterface /** * Returns a traversable set of cache items. * - * @param string[] $keys - * An indexed array of keys of items to retrieve. + * @param list $keys + * An indexed array of keys of items to retrieve. * * @throws CacheArgumentException * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException @@ -178,8 +178,8 @@ public function deleteItem($key): bool /** * Removes multiple items from the pool. * - * @param string[] $keys - * An array of keys that should be removed from the pool. + * @param list $keys + * An array of keys that should be removed from the pool. * * @throws CacheArgumentException * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException From d6087e1489bc6736e0996821492ec678772ec640 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 12:12:42 +0000 Subject: [PATCH 47/58] chore(deps-dev): update rector/rector requirement from 1.0.5 to 1.1.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/1.0.5...1.1.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 b48197c..656c536 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", - "rector/rector": "1.0.5" + "rector/rector": "1.1.0" }, "provide": { "psr/cache-implementation": "^1.0", From 51cda423119763ef54fb3bd401434f88cd1fc73d Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 27 May 2024 11:04:43 +0900 Subject: [PATCH 48/58] chore: fix PHPUnit version to ^9.6 --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 656c536..7766624 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,7 @@ "cache/integration-tests": "^0.17.0", "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", + "phpunit/phpunit": "^9.6", "rector/rector": "1.1.0" }, "provide": { From 5a254b7653eb0b6395b3f8ea784d2156ea3f9b13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:48:58 +0000 Subject: [PATCH 49/58] chore(deps-dev): update rector/rector requirement from 1.1.0 to 1.1.1 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/1.1.0...1.1.1) --- 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 7766624..a2cf398 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", "phpunit/phpunit": "^9.6", - "rector/rector": "1.1.0" + "rector/rector": "1.1.1" }, "provide": { "psr/cache-implementation": "^1.0", From c5938ebeeec8fccab7cdad651e89f89ee2d210ac Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 21 Jun 2024 19:51:29 +0700 Subject: [PATCH 50/58] clean up rector config --- rector.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rector.php b/rector.php index cbd58a1..5422375 100644 --- a/rector.php +++ b/rector.php @@ -22,7 +22,6 @@ use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector; use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; -use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Set\ValueObject\LevelSetList; @@ -31,7 +30,7 @@ use Rector\ValueObject\PhpVersion; 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_80]); $rectorConfig->parallel(); // The paths to refactor (can also be supplied with CLI arguments) $rectorConfig->paths([ @@ -63,7 +62,6 @@ $rectorConfig->skip([ __DIR__ . '/src/Views', - JsonThrowOnErrorRector::class, StringifyStrNeedlesRector::class, // Note: requires php 8 From a02a1bd977b98c81ebc7c52ce0869cd37ebd3a59 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:54:22 +0000 Subject: [PATCH 51/58] chore(deps-dev): update rector/rector requirement from 1.1.1 to 1.2.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/1.1.1...1.2.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 a2cf398..e9c7f14 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", "phpunit/phpunit": "^9.6", - "rector/rector": "1.1.1" + "rector/rector": "1.2.0" }, "provide": { "psr/cache-implementation": "^1.0", From 9b61635d0ce9e5b3f363ebcf7631175580aa5ad5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:40:00 +0000 Subject: [PATCH 52/58] chore(deps-dev): update rector/rector requirement from 1.2.0 to 1.2.1 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/1.2.0...1.2.1) --- 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 e9c7f14..503a21b 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", "phpunit/phpunit": "^9.6", - "rector/rector": "1.2.0" + "rector/rector": "1.2.1" }, "provide": { "psr/cache-implementation": "^1.0", From 33933cc62eaac8112621c4f14fa0a86fca8ff7d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:05:33 +0000 Subject: [PATCH 53/58] chore(deps-dev): update rector/rector requirement from 1.2.1 to 1.2.2 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/1.2.1...1.2.2) --- 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 503a21b..036edf0 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", "phpunit/phpunit": "^9.6", - "rector/rector": "1.2.1" + "rector/rector": "1.2.2" }, "provide": { "psr/cache-implementation": "^1.0", From 1e191a132d5f2085e27ea8c3c5379702f998d5fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 12:16:24 +0000 Subject: [PATCH 54/58] chore(deps-dev): update rector/rector requirement from 1.2.2 to 1.2.4 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/1.2.2...1.2.4) --- 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 036edf0..ee1ba5d 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", "phpunit/phpunit": "^9.6", - "rector/rector": "1.2.2" + "rector/rector": "1.2.4" }, "provide": { "psr/cache-implementation": "^1.0", From e45ed04c1eb2845827c916734f45de6e973f799c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:06:05 +0000 Subject: [PATCH 55/58] chore(deps-dev): update rector/rector requirement from 1.2.4 to 1.2.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/1.2.4...1.2.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 ee1ba5d..1e5df6a 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", "phpunit/phpunit": "^9.6", - "rector/rector": "1.2.4" + "rector/rector": "1.2.5" }, "provide": { "psr/cache-implementation": "^1.0", From 020b3d3096e5a5ce648895b50bda369bbc863e77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:10:31 +0000 Subject: [PATCH 56/58] chore(deps-dev): update rector/rector requirement from 1.2.5 to 1.2.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/1.2.5...1.2.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 1e5df6a..fc74088 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", "phpunit/phpunit": "^9.6", - "rector/rector": "1.2.5" + "rector/rector": "1.2.6" }, "provide": { "psr/cache-implementation": "^1.0", From 662c98c75008931e7bc6a278b664fa3ebd31ca0b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 12:22:57 +0000 Subject: [PATCH 57/58] chore(deps-dev): update rector/rector requirement from 1.2.6 to 1.2.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/1.2.6...1.2.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 fc74088..2c6fbbf 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", "phpunit/phpunit": "^9.6", - "rector/rector": "1.2.6" + "rector/rector": "1.2.7" }, "provide": { "psr/cache-implementation": "^1.0", From 7da4e973190c2128c1393d42411e81ce0dc02344 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:51:21 +0000 Subject: [PATCH 58/58] chore(deps-dev): update rector/rector requirement from 1.2.7 to 1.2.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/1.2.7...1.2.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 2c6fbbf..f4edab2 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "codeigniter4/devkit": "^1.0", "codeigniter4/framework": "^4.1", "phpunit/phpunit": "^9.6", - "rector/rector": "1.2.7" + "rector/rector": "1.2.8" }, "provide": { "psr/cache-implementation": "^1.0",