From 53a254082f7420b89b8ad0bedd48cb46a0ae5cbc Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 22 Nov 2026 10:45:02 +0300 Subject: [PATCH 1/2] PHP 8.6 support --- .github/workflows/bc.yml | 2 +- .github/workflows/build.yml | 22 +++++++++++++++++++ .../composer-dependency-analyser.yml | 2 +- CHANGELOG.md | 1 + README.md | 2 +- composer.json | 2 +- 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bc.yml b/.github/workflows/bc.yml index 6a4a4ec..a564193 100644 --- a/.github/workflows/bc.yml +++ b/.github/workflows/bc.yml @@ -17,4 +17,4 @@ jobs: roave_bc_check: uses: yiisoft/actions/.github/workflows/bc.yml@master with: - php: '["8.4"]' + php: '["8.5"]' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index baf03e7..9309bd8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,28 @@ jobs: - 11 - 12 - 13 + include: + - os: ubuntu-latest + php: 7.4 + pgsql: 13 + - os: ubuntu-latest + php: 8.0 + pgsql: 13 + - os: ubuntu-latest + php: 8.2 + pgsql: 13 + - os: ubuntu-latest + php: 8.3 + pgsql: 13 + - os: ubuntu-latest + php: 8.4 + pgsql: 13 + - os: ubuntu-latest + php: 8.5 + pgsql: 13 + - os: ubuntu-latest + php: 8.6 + pgsql: 13 services: postgres: diff --git a/.github/workflows/composer-dependency-analyser.yml b/.github/workflows/composer-dependency-analyser.yml index e6ee15a..51b0b1a 100644 --- a/.github/workflows/composer-dependency-analyser.yml +++ b/.github/workflows/composer-dependency-analyser.yml @@ -24,4 +24,4 @@ jobs: uses: yiisoft/actions/.github/workflows/composer-dependency-analyser.yml@master with: php: >- - ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] + ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] diff --git a/CHANGELOG.md b/CHANGELOG.md index 15db6e1..c9e84a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.2.1 under development - Chg #60: Replace Psalm with PHPStan (@vjik) +- Chg #61: Change PHP constraint in `composer.json` to `7.4.* || 8.0 - 8.6` (@vjik) ## 1.2.0 November 13, 2026 diff --git a/README.md b/README.md index 6801be4..01c6355 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This library provides a PostgreSQL mutex implementation for [yiisoft/mutex](http ## Requirements -- PHP 7.4 or higher. +- PHP 7.4 - 8.6. - `PDO` PHP extension. ## Installation diff --git a/composer.json b/composer.json index 66cf28a..6801522 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ } ], "require": { - "php": "^7.4|^8.0", + "php": "7.4.* || 8.0 - 8.6", "ext-pdo": "*", "yiisoft/mutex": "^1.1" }, From 82bb07f17e35cc4f6d36650a8fa4204570a637a9 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 22 Nov 2026 10:59:49 +0300 Subject: [PATCH 2/2] fix --- tests/PgsqlMutexKeyTest.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/PgsqlMutexKeyTest.php b/tests/PgsqlMutexKeyTest.php index 7f1c083..c87f779 100644 --- a/tests/PgsqlMutexKeyTest.php +++ b/tests/PgsqlMutexKeyTest.php @@ -37,10 +37,15 @@ public function testAcquireAndReleaseUseFullWidthKeys(string $name, int $key1, i $statement->expects($this->exactly(2))->method('fetchColumn')->willReturn(true); $connection = $this->createMock(PDO::class); $connection->method('getAttribute')->with(PDO::ATTR_DRIVER_NAME)->willReturn('pgsql'); - $connection->expects($this->exactly(2))->method('prepare')->willReturnMap([ - ['SELECT pg_try_advisory_lock(:key1, :key2)', [], $statement], - ['SELECT pg_advisory_unlock(:key1, :key2)', [], $statement], - ]); + $connection->expects($this->exactly(2))->method('prepare')->willReturnCallback( + function (string $query) use ($statement): PDOStatement { + $this->assertContains($query, [ + 'SELECT pg_try_advisory_lock(:key1, :key2)', + 'SELECT pg_advisory_unlock(:key1, :key2)', + ]); + return $statement; + }, + ); $mutex = new PgsqlMutex($name, $connection); $this->assertTrue($mutex->acquire());