From e583525bd9b33eed462e27e47c4e67e85f6f64ab Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Tue, 9 Dec 2025 14:33:54 +0300 Subject: [PATCH 1/3] PHP 8.5 support --- .github/workflows/build.yml | 2 +- .../workflows/composer-require-checker.yml | 2 +- .github/workflows/mutation.yml | 4 ++-- .github/workflows/rector-cs.yml | 2 +- CHANGELOG.md | 2 +- README.md | 2 +- composer.json | 19 +++++++++++++------ tools/.gitignore | 2 ++ tools/infection/composer.json | 10 ++++++++++ tools/psalm/composer.json | 5 +++++ 10 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 tools/.gitignore create mode 100644 tools/infection/composer.json create mode 100644 tools/psalm/composer.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54dfa767..19b694df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,4 +29,4 @@ jobs: os: >- ['ubuntu-latest', 'windows-latest'] php: >- - ['8.1', '8.2', '8.3', '8.4'] + ['8.1', '8.2', '8.3', '8.4', '8.5'] diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml index a93390b1..d2ef508b 100644 --- a/.github/workflows/composer-require-checker.yml +++ b/.github/workflows/composer-require-checker.yml @@ -31,4 +31,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.1', '8.2', '8.3', '8.4'] + ['8.1', '8.2', '8.3', '8.4', '8.5'] diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index a0fbc13f..c691b45f 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -22,12 +22,12 @@ name: mutation test jobs: mutation: - uses: yiisoft/actions/.github/workflows/roave-infection.yml@master + uses: yiisoft/actions/.github/workflows/infection.yml@master with: os: >- ['ubuntu-latest'] php: >- - ['8.1'] + ['8.5'] min-covered-msi: 100 secrets: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/.github/workflows/rector-cs.yml b/.github/workflows/rector-cs.yml index f0d66198..6424c2aa 100644 --- a/.github/workflows/rector-cs.yml +++ b/.github/workflows/rector-cs.yml @@ -24,4 +24,4 @@ jobs: token: ${{ secrets.YIISOFT_GITHUB_TOKEN }} with: repository: ${{ github.event.pull_request.head.repo.full_name }} - php: '8.4' + php: '8.1' diff --git a/CHANGELOG.md b/CHANGELOG.md index 99135053..4aa2edf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,7 +51,7 @@ method when non-positive value is passed (@vjik) - Chg #219: Don't check correctness of current page in `PaginatorInterface::isOnLastPage()` method (@vjik) - Chg #219: Rename `PaginatorException` to `InvalidPageException` (@vjik) -- Chg #211, #221: Change PHP constraint in `composer.json` to `8.1 - 8.4` (@vjik) +- Chg #211, #221, #240: Change PHP constraint in `composer.json` to `8.1 - 8.5` (@vjik) - New #223: Add `Sort::getDefaultOrder()` method (@vjik) - Enh #223: `KeysetPaginator` now uses default order from `Sort` when no sort is set (@vjik) - Chg #224: Change `$iterableFilterHandlers` to context object in `IterableFilterHandlerInterface::match()` (@vjik) diff --git a/README.md b/README.md index 88c1d9eb..f835dae5 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Features are: ## Requirements -- PHP 8.1 or higher. +- PHP 8.1 - 8.5. ## Installation diff --git a/composer.json b/composer.json index 3cb23e46..e5ebb99b 100644 --- a/composer.json +++ b/composer.json @@ -31,18 +31,17 @@ } ], "require": { - "php": "8.1 - 8.4", + "php": "8.1 - 8.5", "ext-mbstring": "*", "yiisoft/arrays": "^3.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.3", "friendsofphp/php-cs-fixer": "^3.89.2", "maglnet/composer-require-checker": "^4.7.1", "phpunit/phpunit": "^10.5.52", "rector/rector": "^2.2.8", - "roave/infection-static-analysis-plugin": "^1.35", - "spatie/phpunit-watcher": "^1.24", - "vimeo/psalm": "^5.26.1 || ^6.10.3" + "spatie/phpunit-watcher": "^1.24" }, "autoload": { "psr-4": { @@ -54,16 +53,24 @@ "Yiisoft\\Data\\Tests\\": "tests" } }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "target-directory": "tools", + "forward-command": true + } + }, "config": { "sort-packages": true, "allow-plugins": { - "infection/extension-installer": true, + "bamarni/composer-bin-plugin": true, "composer/package-versions-deprecated": true } }, "scripts": { "test": "phpunit --testdox --no-interaction", "test-watch": "phpunit-watcher watch", - "cs-fix": "php-cs-fixer fix" + "cs-fix": "php-cs-fixer fix", + "mutation": "infection --threads=max --min-covered-msi=100" } } diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 00000000..cf452dcf --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1,2 @@ +/*/vendor +/*/composer.lock diff --git a/tools/infection/composer.json b/tools/infection/composer.json new file mode 100644 index 00000000..18be2ea1 --- /dev/null +++ b/tools/infection/composer.json @@ -0,0 +1,10 @@ +{ + "require-dev": { + "infection/infection": "^0.26 || ^0.31.9" + }, + "config": { + "allow-plugins": { + "infection/extension-installer": true + } + } +} diff --git a/tools/psalm/composer.json b/tools/psalm/composer.json new file mode 100644 index 00000000..cfbd3f43 --- /dev/null +++ b/tools/psalm/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "vimeo/psalm": "^5.26.1 || ^6.10.3" + } +} From 82e106c08e43494d821c6f9a426c2e65b39e90e7 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Tue, 9 Dec 2025 14:52:24 +0300 Subject: [PATCH 2/3] mutant 1 --- tests/Paginator/OffsetPaginatorTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Paginator/OffsetPaginatorTest.php b/tests/Paginator/OffsetPaginatorTest.php index 1be4a3c4..3999f18e 100644 --- a/tests/Paginator/OffsetPaginatorTest.php +++ b/tests/Paginator/OffsetPaginatorTest.php @@ -517,6 +517,7 @@ public static function dataIsSupportSorting(): array { return [ 'IterableDataReader' => [true, new IterableDataReader([])], + 'IterableDataReaderWithLimit' => [false, (new IterableDataReader([]))->withLimit(10)], 'StubOffsetData' => [false, new StubOffsetData()], 'StubOffsetDataWithLimit' => [false, (new StubOffsetData())->withLimit(10)], ]; From 9730b5ef7a9f1dd44bdcf7f248f4d6f8c6bf12c2 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Tue, 9 Dec 2025 14:54:52 +0300 Subject: [PATCH 3/3] mutant 2 --- src/Paginator/KeysetPaginator.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Paginator/KeysetPaginator.php b/src/Paginator/KeysetPaginator.php index a1393472..25481bcc 100644 --- a/src/Paginator/KeysetPaginator.php +++ b/src/Paginator/KeysetPaginator.php @@ -299,6 +299,7 @@ public function withFilter(FilterInterface $filter): static public function isOnFirstPage(): bool { if ($this->token === null) { + /** @infection-ignore-all */ return true; } @@ -323,6 +324,7 @@ public function isPaginationRequired(): bool private function initialize(): void { if ($this->readCache !== null) { + /** @infection-ignore-all */ return; }