From c6f205a812ea6284aab28f532d5872030237f5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 04:00:52 +0200 Subject: [PATCH 1/6] chore: add php 8.5 to tests --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 523fa88..32d5e24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,7 @@ jobs: - ubuntu-latest php-version: - '8.4' + - '8.5' steps: - name: Checkout From 1cf8356585be1b9934e80920f765fbd6d5316cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 04:12:12 +0200 Subject: [PATCH 2/6] update xdebug install version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index de09546..df10510 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN docker-php-ext-install \ RUN apk add --no-cache \ $PHPIZE_DEPS \ linux-headers \ - && pecl install xdebug-3.4.2 \ + && pecl install xdebug-3.5.1 \ && docker-php-ext-enable xdebug \ && rm -rf /tmp/* /var/cache/apk/* From 7ce98d55bad9ea2a43ae4fbc4262bfa666934314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 22:06:07 +0200 Subject: [PATCH 3/6] updates --- .github/workflows/test.yml | 13 +++++++++---- composer.json | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32d5e24..90b4473 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,12 +8,13 @@ concurrency: cancel-in-progress: true on: - push: - paths-ignore: - - '**.md' pull_request: paths-ignore: - '**.md' + types: + - opened + - synchronize + - reopened jobs: test: @@ -38,8 +39,12 @@ jobs: - name: Build run: docker compose build --build-arg PHPVERSION=${{ matrix.php-version }} + - name: Lint + if: matrix.php-version == '8.4' + run: docker compose run lib composer lint + - name: Test - run: docker compose run -e "PHP_CS_FIXER_IGNORE_ENV=True" lib composer ci + run: docker compose run lib composer test - name: Upload coverage uses: codecov/codecov-action@v6 diff --git a/composer.json b/composer.json index c7e7beb..bd857b1 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "php-cs-fixer fix -vvv" ], "test": [ - "phpunit --colors --coverage-html ./coverage --coverage-clover coverage/clover.xml" + "phpunit --colors --display-deprecation --coverage-html ./coverage --coverage-clover coverage/clover.xml" ] } } From b10a7bcbc09bd7516b84add7e6bbf48a21305c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 22:30:28 +0200 Subject: [PATCH 4/6] deprecated --- src/Configurator.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Configurator.php b/src/Configurator.php index 70125c4..bf5a381 100644 --- a/src/Configurator.php +++ b/src/Configurator.php @@ -243,7 +243,11 @@ public function getParametersForPDO(): array $parameters = $this->getParameters(); if ($this->getDriver() === 'mysql') { - $parameters[\PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES ' . $this->getCharset(); + if (PHP_VERSION_ID >= 80500) { + $parameters[\Pdo\Mysql::ATTR_INIT_COMMAND] = 'SET NAMES ' . $this->getCharset(); + } else { + $parameters[\PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES ' . $this->getCharset(); + } } $parameters[\PDO::ATTR_ERRMODE] = \PDO::ERRMODE_EXCEPTION; From ce0aa3573ae193972ae582d7b77768e6b97b05ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 22:36:48 +0200 Subject: [PATCH 5/6] deprecated --- tests/ConfiguratorTest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/ConfiguratorTest.php b/tests/ConfiguratorTest.php index d675740..02ca319 100644 --- a/tests/ConfiguratorTest.php +++ b/tests/ConfiguratorTest.php @@ -464,8 +464,14 @@ public function testGetParametersForPDOMysql(): void $conf = new Configurator($params); + if (PHP_VERSION_ID >= 80500) { + $parameterValueForAttrInitCommand = \Pdo\Mysql::ATTR_INIT_COMMAND; + } else { + $parameterValueForAttrInitCommand = \PDO::MYSQL_ATTR_INIT_COMMAND; + } + $expected = [ - \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', + $parameterValueForAttrInitCommand => 'SET NAMES utf8mb4', \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_PERSISTENT => false ]; @@ -473,7 +479,7 @@ public function testGetParametersForPDOMysql(): void $conf->setCharset('charset'); $expected = [ - \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES charset', + $parameterValueForAttrInitCommand => 'SET NAMES charset', \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_PERSISTENT => false ]; @@ -481,7 +487,7 @@ public function testGetParametersForPDOMysql(): void $conf->enablePersistentConnection(); $expected = [ - \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES charset', + $parameterValueForAttrInitCommand => 'SET NAMES charset', \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_PERSISTENT => true ]; From e1af7de5f6ba506549335312a9cfb1d3633540df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 23:27:32 +0200 Subject: [PATCH 6/6] use --display-all-issues --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bd857b1..a217cd7 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "php-cs-fixer fix -vvv" ], "test": [ - "phpunit --colors --display-deprecation --coverage-html ./coverage --coverage-clover coverage/clover.xml" + "phpunit --colors --display-all-issues --coverage-html ./coverage --coverage-clover coverage/clover.xml" ] } }