From 569621368b4ea4c109e9d199a99865cb66ccd68d Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 30 Nov 2025 11:31:30 +0300 Subject: [PATCH 1/6] PHP 8.5 support --- .github/workflows/active-record.yml | 2 +- .github/workflows/build.yml | 1 + .github/workflows/composer-require-checker.yml | 2 +- .github/workflows/db-mariadb.yml | 4 +++- .github/workflows/db-migration.yml | 2 +- .github/workflows/db-mssql-2017.yml | 2 +- .github/workflows/db-mssql.yml | 1 + .github/workflows/db-mysql.yml | 4 +++- .github/workflows/db-oracle.yml | 4 +++- .github/workflows/db-pgsql.yml | 4 +++- .github/workflows/db-sqlite.yml | 1 + .github/workflows/rector-cs.yml | 2 +- CHANGELOG.md | 2 +- README.md | 2 +- composer.json | 12 ++++++++---- tools/.gitignore | 2 ++ tools/infection/composer.json | 10 ++++++++++ tools/psalm/composer.json | 5 +++++ 18 files changed, 47 insertions(+), 15 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/active-record.yml b/.github/workflows/active-record.yml index b5b86406b..3a9b1e4ae 100644 --- a/.github/workflows/active-record.yml +++ b/.github/workflows/active-record.yml @@ -24,7 +24,7 @@ jobs: env: COMPOSER_ROOT_VERSION: dev-master - PHP_VERSION: 8.4 + PHP_VERSION: 8.5 EXTENSIONS: pdo, pdo_mysql, pdo_oci, pdo_pgsql, pdo_sqlite, pdo_sqlsrv runs-on: ubuntu-latest diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fb0ad07c..dc2af4201 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,6 +42,7 @@ jobs: - 8.2 - 8.3 - 8.4 + - 8.5 steps: - name: Checkout. diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml index 7b77e05e5..3cc6fe542 100644 --- a/.github/workflows/composer-require-checker.yml +++ b/.github/workflows/composer-require-checker.yml @@ -27,4 +27,4 @@ jobs: uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master with: php: >- - ['8.1', '8.2', '8.3', '8.4'] + ['8.1', '8.2', '8.3', '8.4', '8.5'] diff --git a/.github/workflows/db-mariadb.yml b/.github/workflows/db-mariadb.yml index 14495ce77..f59a67b27 100644 --- a/.github/workflows/db-mariadb.yml +++ b/.github/workflows/db-mariadb.yml @@ -36,7 +36,7 @@ jobs: strategy: matrix: php: - - 8.4 + - 8.5 mariadb: - mariadb:10.4 @@ -54,6 +54,8 @@ jobs: mariadb: mariadb:latest - php: 8.3 mariadb: mariadb:latest + - php: 8.4 + mariadb: mariadb:latest services: mysql: diff --git a/.github/workflows/db-migration.yml b/.github/workflows/db-migration.yml index 45f5cc22e..1d758aefe 100644 --- a/.github/workflows/db-migration.yml +++ b/.github/workflows/db-migration.yml @@ -24,7 +24,7 @@ jobs: env: COMPOSER_ROOT_VERSION: dev-master - PHP_VERSION: 8.4 + PHP_VERSION: 8.5 EXTENSIONS: pdo, pdo_mysql, pdo_oci, pdo_pgsql, pdo_sqlite, pdo_sqlsrv runs-on: ubuntu-latest diff --git a/.github/workflows/db-mssql-2017.yml b/.github/workflows/db-mssql-2017.yml index ee82a547a..f54ef78bc 100644 --- a/.github/workflows/db-mssql-2017.yml +++ b/.github/workflows/db-mssql-2017.yml @@ -28,7 +28,7 @@ jobs: env: COMPOSER_ROOT_VERSION: dev-master - PHP_VERSION: 8.4 + PHP_VERSION: 8.5 EXTENSIONS: pdo, pdo_sqlsrv runs-on: windows-latest diff --git a/.github/workflows/db-mssql.yml b/.github/workflows/db-mssql.yml index 2bf9bbf1f..f6e5b1097 100644 --- a/.github/workflows/db-mssql.yml +++ b/.github/workflows/db-mssql.yml @@ -39,6 +39,7 @@ jobs: - 8.2 - 8.3 - 8.4 + - 8.5 mssql: - 2022-latest diff --git a/.github/workflows/db-mysql.yml b/.github/workflows/db-mysql.yml index b936131bf..b2ae175b8 100644 --- a/.github/workflows/db-mysql.yml +++ b/.github/workflows/db-mysql.yml @@ -35,7 +35,7 @@ jobs: strategy: matrix: php: - - 8.4 + - 8.5 mysql: - mysql:5.7 @@ -48,6 +48,8 @@ jobs: mysql: mysql:latest - php: 8.3 mysql: mysql:latest + - php: 8.4 + mysql: mysql:latest services: mysql: diff --git a/.github/workflows/db-oracle.yml b/.github/workflows/db-oracle.yml index da62a6c9e..28e3c9506 100644 --- a/.github/workflows/db-oracle.yml +++ b/.github/workflows/db-oracle.yml @@ -35,7 +35,7 @@ jobs: strategy: matrix: php: - - 8.4 + - 8.5 oracle: - 18 @@ -48,6 +48,8 @@ jobs: oracle: 21 - php: 8.3 oracle: 21 + - php: 8.4 + oracle: 21 services: oci: diff --git a/.github/workflows/db-pgsql.yml b/.github/workflows/db-pgsql.yml index 4fced7aa7..9c26d4d2d 100644 --- a/.github/workflows/db-pgsql.yml +++ b/.github/workflows/db-pgsql.yml @@ -35,7 +35,7 @@ jobs: strategy: matrix: php: - - 8.4 + - 8.5 pgsql: - 9 @@ -56,6 +56,8 @@ jobs: pgsql: 18 - php: 8.3 pgsql: 18 + - php: 8.4 + pgsql: 18 services: postgres: diff --git a/.github/workflows/db-sqlite.yml b/.github/workflows/db-sqlite.yml index b2e2428ae..d84c977d9 100644 --- a/.github/workflows/db-sqlite.yml +++ b/.github/workflows/db-sqlite.yml @@ -43,6 +43,7 @@ jobs: - 8.2 - 8.3 - 8.4 + - 8.5 steps: - name: Checkout. diff --git a/.github/workflows/rector-cs.yml b/.github/workflows/rector-cs.yml index 8ffec114a..a5d3d4566 100644 --- a/.github/workflows/rector-cs.yml +++ b/.github/workflows/rector-cs.yml @@ -25,4 +25,4 @@ jobs: token: ${{ secrets.YIISOFT_GITHUB_TOKEN }} with: repository: ${{ github.event.pull_request.head.repo.full_name }} - php: '8.4' + php: '8.5' diff --git a/CHANGELOG.md b/CHANGELOG.md index ac8df1afa..99a2196f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,7 +69,7 @@ - Enh #929: Refactor array, structured and JSON column type expressions and expression builders (@Tigrov) - Enh #929: Implement lazy arrays for array, structured and JSON column types (@Tigrov) - Bug #933: Explicitly mark nullable parameters (@vjik) -- Chg #911: Change supported PHP versions to `8.1 - 8.4` (@Tigrov) +- Chg #911, #1113: Change supported PHP versions to `8.1 - 8.5` (@Tigrov, @vjik) - Enh #911, #940: Minor refactoring (@Tigrov) - Chg #938, #936, #937: Remove `ext-json`, `ext-ctype`, `ext-mbstring` from `require` section of `composer.json` (@Tigrov) - Chg #936: Remove `hasLimit()` and `hasOffset()` methods from `AbstractDQLQueryBuilder` class (@Tigrov) diff --git a/README.md b/README.md index 250848789..00b5f81f1 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Optional packages that provide additional functionality: ## Requirements -- PHP 8.1 - 8.4. +- PHP 8.1 - 8.5. - `pdo` PHP extension. ## Installation diff --git a/composer.json b/composer.json index 30da9f86f..a0deda5cc 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ } ], "require": { - "php": "8.1 - 8.4", + "php": "8.1 - 8.5", "ext-pdo": "*", "psr/log": "^2.0|^3.0", "psr/simple-cache": "^2.0|^3.0", @@ -38,13 +38,12 @@ "yiisoft/db-implementation": "1.0.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.3", "friendsofphp/php-cs-fixer": "^3.89.1", "maglnet/composer-require-checker": "^4.7.1", "phpunit/phpunit": "^10.5.45", "rector/rector": "^2.0.10", - "roave/infection-static-analysis-plugin": "^1.35", "spatie/phpunit-watcher": "^1.24", - "vimeo/psalm": "^5.26.1 || ^6.8.8", "yiisoft/aliases": "^3.0", "yiisoft/di": "^1.3", "yiisoft/dummy-provider": "^1.1", @@ -87,6 +86,11 @@ } }, "extra": { + "bamarni-bin": { + "bin-links": true, + "target-directory": "tools", + "forward-command": true + }, "config-plugin-options": { "source-directory": "config" }, @@ -97,7 +101,7 @@ "config": { "sort-packages": true, "allow-plugins": { - "infection/extension-installer": true, + "bamarni/composer-bin-plugin": true, "composer/package-versions-deprecated": true, "yiisoft/config": false } diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 000000000..cf452dcfc --- /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 000000000..18be2ea10 --- /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 000000000..44e11e3ef --- /dev/null +++ b/tools/psalm/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "vimeo/psalm": "^5.26.1 || ^6.8.8" + } +} From d55d5ea0245cfd719bc72885c441fdc554eea3e7 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 30 Nov 2025 12:11:39 +0300 Subject: [PATCH 2/6] fix --- tests/Common/CommonCommandTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Common/CommonCommandTest.php b/tests/Common/CommonCommandTest.php index 87436809c..fb2bb758e 100644 --- a/tests/Common/CommonCommandTest.php +++ b/tests/Common/CommonCommandTest.php @@ -519,7 +519,7 @@ public function testBatchInsert( */ public function testBatchInsertDataTypesLocale(): void { - $locale = setlocale(LC_NUMERIC, 0); + $locale = setlocale(LC_NUMERIC, ''); if ($locale === false) { $this->markTestSkipped('Your platform does not support locales.'); From c85b045bf6d455e56868e754e5aa198859b3537b Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 30 Nov 2025 14:41:32 +0300 Subject: [PATCH 3/6] improve --- src/Schema/Column/IntegerColumn.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Schema/Column/IntegerColumn.php b/src/Schema/Column/IntegerColumn.php index ab2fd6191..0eed1b8dc 100644 --- a/src/Schema/Column/IntegerColumn.php +++ b/src/Schema/Column/IntegerColumn.php @@ -12,6 +12,7 @@ use Yiisoft\Db\Expression\ExpressionInterface; use function gettype; +use function is_string; /** * Represents the schema for an integer column. @@ -46,6 +47,10 @@ public function phpTypecast(mixed $value): ?int return null; } + if (is_string($value)) { + $value = rtrim($value, '.'); + } + return (int) $value; } } From be21e54577ab57d2804f50e4a9d46ccc439c89f6 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 30 Nov 2025 15:00:00 +0300 Subject: [PATCH 4/6] test --- tests/Db/Schema/Column/IntegerColumnTest.php | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/Db/Schema/Column/IntegerColumnTest.php diff --git a/tests/Db/Schema/Column/IntegerColumnTest.php b/tests/Db/Schema/Column/IntegerColumnTest.php new file mode 100644 index 000000000..dd832a152 --- /dev/null +++ b/tests/Db/Schema/Column/IntegerColumnTest.php @@ -0,0 +1,28 @@ +phpTypecast($value); + + $this->assertSame($expectedValue, $result); + } +} From f76389c7ca4454de921a1c22d814c4365313692c Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 30 Nov 2025 15:01:57 +0300 Subject: [PATCH 5/6] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99a2196f4..fbcb50f13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -179,6 +179,7 @@ - Chg #1106: Remove parameters from `PdoConnectionInterface::getActivePdo()` method (@vjik) - Bug #1109: Fix column definition parsing in cases with brackets and escaped quotes (@vjik) - New #1107: Add abstract enumeration column type (@vjik) +- New #1113: Trim dot in `IntegerColumn::phpTypecast()` to prevent PHP 8.5+ warnings on large values (@vjik) ## 1.3.0 March 21, 2024 From 9f492eae7df37eba958eb3b7d4949aded2e9786f Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 30 Nov 2025 16:59:32 +0300 Subject: [PATCH 6/6] rm --- CHANGELOG.md | 1 - src/Schema/Column/IntegerColumn.php | 5 ---- tests/Db/Schema/Column/IntegerColumnTest.php | 28 -------------------- 3 files changed, 34 deletions(-) delete mode 100644 tests/Db/Schema/Column/IntegerColumnTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index fbcb50f13..99a2196f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -179,7 +179,6 @@ - Chg #1106: Remove parameters from `PdoConnectionInterface::getActivePdo()` method (@vjik) - Bug #1109: Fix column definition parsing in cases with brackets and escaped quotes (@vjik) - New #1107: Add abstract enumeration column type (@vjik) -- New #1113: Trim dot in `IntegerColumn::phpTypecast()` to prevent PHP 8.5+ warnings on large values (@vjik) ## 1.3.0 March 21, 2024 diff --git a/src/Schema/Column/IntegerColumn.php b/src/Schema/Column/IntegerColumn.php index 0eed1b8dc..ab2fd6191 100644 --- a/src/Schema/Column/IntegerColumn.php +++ b/src/Schema/Column/IntegerColumn.php @@ -12,7 +12,6 @@ use Yiisoft\Db\Expression\ExpressionInterface; use function gettype; -use function is_string; /** * Represents the schema for an integer column. @@ -47,10 +46,6 @@ public function phpTypecast(mixed $value): ?int return null; } - if (is_string($value)) { - $value = rtrim($value, '.'); - } - return (int) $value; } } diff --git a/tests/Db/Schema/Column/IntegerColumnTest.php b/tests/Db/Schema/Column/IntegerColumnTest.php deleted file mode 100644 index dd832a152..000000000 --- a/tests/Db/Schema/Column/IntegerColumnTest.php +++ /dev/null @@ -1,28 +0,0 @@ -phpTypecast($value); - - $this->assertSame($expectedValue, $result); - } -}