diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54dfa76..19b694d 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 a93390b..d2ef508 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 a0fbc13..c691b45 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 f0d6619..6424c2a 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 9913505..4aa2edf 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 88c1d9e..f835dae 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 3cb23e4..e5ebb99 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/src/Paginator/KeysetPaginator.php b/src/Paginator/KeysetPaginator.php index a139347..25481bc 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; } diff --git a/tests/Paginator/OffsetPaginatorTest.php b/tests/Paginator/OffsetPaginatorTest.php index 1be4a3c..3999f18 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)], ]; diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 0000000..cf452dc --- /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 0000000..18be2ea --- /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 0000000..cfbd3f4 --- /dev/null +++ b/tools/psalm/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "vimeo/psalm": "^5.26.1 || ^6.10.3" + } +}