Skip to content

Commit cf90e9f

Browse files
committed
Require PHP 8.4 and avoid PHP 8.5 deprecations
1 parent a1167f2 commit cf90e9f

File tree

12 files changed

+30
-29
lines changed

12 files changed

+30
-29
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
/vendor-bin export-ignore
88
/.editorconfig export-ignore
99
/.gitattributes export-ignore
10-
/.gitignore export-ignore
11-
/captainhook.json export-ignore
10+
/.gitignore export-ignore

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=8.2",
23+
"php": ">=8.4",
2424
"ext-pdo": "*"
2525
},
2626
"require-dev": {
2727
"captainhook/captainhook-phar": "^5.0",
2828
"captainhook/hook-installer": "^1.0",
29-
"phpunit/phpunit": "^11.4",
29+
"phpunit/phpunit": "^12.0",
3030
"mockery/mockery": "^1.0",
3131
"squirrelphp/types": "^1.0",
32-
"symfony/finder": "^7.0",
33-
"symfony/process": "^7.0"
32+
"symfony/finder": "^8.0",
33+
"symfony/process": "^8.0"
3434
},
3535
"suggest": {
3636
"squirrelphp/queries": "Symfony integration of squirrelphp/queries - automatic assembling of decorated connections",

docker/Dockerfile/mariadb_ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ COPY docker/ssl/db_ssl.crt /etc/mysql/certs/server.crt
55
COPY docker/ssl/db_ssl.key /etc/mysql/certs/server.key
66
COPY docker/ssl/DadaismCA.crt /etc/mysql/certs/ca.crt
77

8-
RUN chmod 600 /etc/mysql/certs/server.key
9-
RUN chown mysql:mysql /etc/mysql/certs/server.key
8+
RUN chmod 600 /etc/mysql/certs/*
9+
RUN chown mysql:mysql /etc/mysql/certs/*

docker/Dockerfile/mysql_ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ COPY docker/ssl/db_ssl.crt /etc/mysql/certs/server.crt
55
COPY docker/ssl/db_ssl.key /etc/mysql/certs/server.key
66
COPY docker/ssl/DadaismCA.crt /etc/mysql/certs/ca.crt
77

8-
RUN chmod 600 /etc/mysql/certs/server.key
9-
RUN chown mysql:mysql /etc/mysql/certs/server.key
8+
RUN chmod 600 /etc/mysql/certs/*
9+
RUN chown mysql:mysql /etc/mysql/certs/*

docker/Dockerfile/postgres_ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ COPY docker/ssl/db_ssl.crt /var/lib/postgresql/server.crt
55
COPY docker/ssl/db_ssl.key /var/lib/postgresql/server.key
66
COPY docker/ssl/DadaismCA.crt /var/lib/postgresql/ca.crt
77

8-
RUN chmod 600 /var/lib/postgresql/server.key
9-
RUN chown postgres:postgres /var/lib/postgresql/server.key
8+
RUN chmod 600 /var/lib/postgresql/*
9+
RUN chown postgres:postgres /var/lib/postgresql/*

docker/compose/composer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
composer:
3-
image: thecodingmachine/php:8.2-v4-cli
3+
image: thecodingmachine/php:8.5-v5-cli
44
container_name: squirrel_composer
55
working_dir: /usr/src/app
66
command: [ "composer", "${COMPOSER_COMMAND}", "--ansi" ]

docker/compose/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
coverage:
3-
image: thecodingmachine/php:8.4-v4-cli
3+
image: thecodingmachine/php:8.5-v5-cli
44
container_name: squirrel_connection_coverage
55
tty: true
66
working_dir: /usr/src/app

docker/compose/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
test:
3-
image: thecodingmachine/php:8.2-v4-cli
3+
image: thecodingmachine/php:8.5-v5-cli
44
container_name: squirrel_connection_test
55
tty: true
66
working_dir: /usr/src/app

src/PDO/ConnectionPDO.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Squirrel\Connection\PDO;
44

55
use PDO;
6+
use Pdo\Mysql as PdoMysql;
7+
use Pdo\Pgsql as PdoPgsql;
68
use PDOException;
79
use Squirrel\Connection\Config\Mysql;
810
use Squirrel\Connection\Config\Pgsql;
@@ -33,15 +35,15 @@ public function __construct(
3335
$options[PDO::ATTR_AUTOCOMMIT] = true;
3436

3537
if ($this->config instanceof Mysql) {
36-
$options[PDO::MYSQL_ATTR_MULTI_STATEMENTS] = false;
37-
$options[PDO::MYSQL_ATTR_FOUND_ROWS] = true;
38+
$options[PdoMysql::ATTR_MULTI_STATEMENTS] = false;
39+
$options[PdoMysql::ATTR_FOUND_ROWS] = true;
3840

3941
if ($this->config->ssl !== null) {
40-
$options[PDO::MYSQL_ATTR_SSL_CA] = $this->config->ssl->rootCertificatePath;
41-
$options[PDO::MYSQL_ATTR_SSL_KEY] = $this->config->ssl->privateKeyPath;
42-
$options[PDO::MYSQL_ATTR_SSL_CERT] = $this->config->ssl->certificatePath;
42+
$options[PdoMysql::ATTR_SSL_CA] = $this->config->ssl->rootCertificatePath;
43+
$options[PdoMysql::ATTR_SSL_KEY] = $this->config->ssl->privateKeyPath;
44+
$options[PdoMysql::ATTR_SSL_CERT] = $this->config->ssl->certificatePath;
4345

44-
$options[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = match ($this->config->ssl->verification) {
46+
$options[PdoMysql::ATTR_SSL_VERIFY_SERVER_CERT] = match ($this->config->ssl->verification) {
4547
SslVerification::None => false,
4648
SslVerification::Ca => throw new InvalidArgumentException('Mysql SSL connections do not support to only verify the CA - only no verification or both CA and hostname verification are supported by the PHP driver'),
4749
SslVerification::CaAndHostname => true,
@@ -50,7 +52,7 @@ public function __construct(
5052
}
5153

5254
if ($this->config instanceof Pgsql) {
53-
$options[PDO::PGSQL_ATTR_DISABLE_PREPARES] = false;
55+
$options[PdoPgsql::ATTR_DISABLE_PREPARES] = false;
5456
}
5557

5658
$this->options = $options;

tools/phpstan-baseline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
$ignoreErrors = [];
44
$ignoreErrors[] = [
5-
'message' => '#^Method Squirrel\\\\Connection\\\\PDO\\\\ConnectionPDO\\:\\:fetchAll\\(\\) should return list\\<array\\<string, bool\\|float\\|int\\|string\\|null\\>\\> but returns array\\.$#',
5+
'message' => '#^Method Squirrel\\\\Connection\\\\PDO\\\\ConnectionPDO\\:\\:fetchAll\\(\\) should return list\\<array\\<string, bool\\|float\\|int\\|string\\|null\\>\\> but returns array\\<array\\>\\.$#',
66
'identifier' => 'return.type',
77
'count' => 1,
88
'path' => __DIR__ . '/../src/PDO/ConnectionPDO.php',

0 commit comments

Comments
 (0)