From d923a65170b33575fc37c6ea77863d80c37ee466 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij Date: Wed, 1 Oct 2025 12:26:21 +0200 Subject: [PATCH 01/11] Run tests on PHP 8.5 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c45d933d5171..377bfb783a94 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.3, 8.4] + php: [8.2, 8.3, 8.4, 8.5] phpunit: ['10.5.35', '11.5.3', '12.0.0', '12.3.0'] stability: [prefer-lowest, prefer-stable] exclude: @@ -116,7 +116,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.3, 8.4] + php: [8.2, 8.3, 8.4, 8.5] phpunit: ['10.5.35', '11.5.3', '12.0.0', '12.3.0'] stability: [prefer-lowest, prefer-stable] exclude: From 6f7a3ca1a1ad0d064852efeb917044adc2e55bcd Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 21 Oct 2025 10:40:33 +0800 Subject: [PATCH 02/11] wip --- .github/workflows/tests.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c8e3f3b3f228..ffc4f8d33dd8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.3, 8.4, 8.5] + php: [8.2, 8.3, 8.4] phpunit: ['10.5.35', '11.5.3', '12.0.0', '12.4.0'] stability: [prefer-lowest, prefer-stable] exclude: @@ -48,6 +48,9 @@ jobs: - php: 8.2 phpunit: '12.4.0' include: + - php: 8.5 + phpunit: '12.4.0' + stability: prefer-stable - php: 8.3 phpunit: '12.1.0' stability: prefer-stable @@ -110,7 +113,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.3, 8.4, 8.5] + php: [8.2, 8.3, 8.4] phpunit: ['10.5.35', '11.5.3', '12.0.0', '12.4.0'] stability: [prefer-lowest, prefer-stable] exclude: @@ -119,6 +122,9 @@ jobs: - php: 8.2 phpunit: '12.4.0' include: + - php: 8.5 + phpunit: '12.4.0' + stability: prefer-stable - php: 8.3 phpunit: '12.1.0' stability: prefer-stable From 1a20c84bfacc72282b9208a888030fa7ce1d2f87 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 21 Oct 2025 12:16:31 +0800 Subject: [PATCH 03/11] [12.x] Configures PDO constant using methods for PHP 8.5 This allows Laravel to handle deprecated constant introduced in PHP 8.5 Signed-off-by: Mior Muhammad Zaki --- config/database.php | 6 ++++-- src/Illuminate/Database/Connectors/Connector.php | 2 +- .../Database/Connectors/MySqlConnector.php | 14 ++++++++++++++ .../Database/Connectors/SQLiteConnector.php | 14 ++++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/config/database.php b/config/database.php index 1d9883833e62..3d1b0eedf738 100644 --- a/config/database.php +++ b/config/database.php @@ -1,5 +1,7 @@ true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + MySqlConnector::feature('SSL_CA') => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], @@ -81,7 +83,7 @@ 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + MariaDbConnector::feature('SSL_CA') => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], diff --git a/src/Illuminate/Database/Connectors/Connector.php b/src/Illuminate/Database/Connectors/Connector.php index a40bd2c6b861..242a802e6d65 100755 --- a/src/Illuminate/Database/Connectors/Connector.php +++ b/src/Illuminate/Database/Connectors/Connector.php @@ -62,7 +62,7 @@ public function createConnection($dsn, array $config, array $options) */ protected function createPdoConnection($dsn, $username, #[\SensitiveParameter] $password, $options) { - return version_compare(phpversion(), '8.4.0', '<') + return PHP_VERSION_ID < 80400 ? new PDO($dsn, $username, $password, $options) : PDO::connect($dsn, $username, $password, $options); /** @phpstan-ignore staticMethod.notFound (PHP 8.4) */ } diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index fc55b801407f..bc2350352d55 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -3,9 +3,23 @@ namespace Illuminate\Database\Connectors; use PDO; +use Illuminate\Support\Str; class MySqlConnector extends Connector implements ConnectorInterface { + /** + * Determine of PDO feature constant. + * + * @param string $feature + * @return mixed + */ + public static function feature(string $feature) + { + return constant( + (string) Str::of($feature)->prepend('ATTR_')->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::') + ); + } + /** * Establish a database connection. * diff --git a/src/Illuminate/Database/Connectors/SQLiteConnector.php b/src/Illuminate/Database/Connectors/SQLiteConnector.php index 858549ec55de..bf5e114db0f8 100755 --- a/src/Illuminate/Database/Connectors/SQLiteConnector.php +++ b/src/Illuminate/Database/Connectors/SQLiteConnector.php @@ -3,9 +3,23 @@ namespace Illuminate\Database\Connectors; use Illuminate\Database\SQLiteDatabaseDoesNotExistException; +use Illuminate\Support\Str; class SQLiteConnector extends Connector implements ConnectorInterface { + /** + * Determine of PDO feature constant. + * + * @param string $feature + * @return mixed + */ + public static function feature(string $feature) + { + return constant( + (string) Str::of($feature)->prepend('ATTR_')->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::') + ); + } + /** * Establish a database connection. * From f5c1e3903df291d78dc5943d76470b91daf9ee81 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 21 Oct 2025 04:20:00 +0000 Subject: [PATCH 04/11] Apply fixes from StyleCI --- src/Illuminate/Database/Connectors/MySqlConnector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index bc2350352d55..6036c01e8707 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -2,8 +2,8 @@ namespace Illuminate\Database\Connectors; -use PDO; use Illuminate\Support\Str; +use PDO; class MySqlConnector extends Connector implements ConnectorInterface { From 18982c081d97f3a237ab6a8f8e1505ef1e0f92a6 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 21 Oct 2025 13:04:28 +0800 Subject: [PATCH 05/11] Use dev version Signed-off-by: Mior Muhammad Zaki --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3cd0043c01e2..1c9095ca33a3 100644 --- a/composer.json +++ b/composer.json @@ -115,7 +115,7 @@ "league/flysystem-sftp-v3": "^3.25.1", "mockery/mockery": "^1.6.10", "opis/json-schema": "^2.4.1", - "orchestra/testbench-core": "^10.7.0", + "orchestra/testbench-core": "dev-10/php85 as 10.999.999", "pda/pheanstalk": "^5.0.6|^7.0.0", "php-http/discovery": "^1.15", "phpstan/phpstan": "^2.0", From da7a6cfa0a5261501a0918cf42f94e875fcf56e9 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 21 Oct 2025 14:17:37 +0800 Subject: [PATCH 06/11] wip Signed-off-by: Mior Muhammad Zaki --- config/database.php | 12 ++++++------ .../Database/Connectors/MySqlConnector.php | 17 +++++++++++------ .../Database/Connectors/SQLiteConnector.php | 17 +++++++++++------ 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/config/database.php b/config/database.php index 3d1b0eedf738..5254446e353c 100644 --- a/config/database.php +++ b/config/database.php @@ -62,9 +62,9 @@ 'prefix_indexes' => true, 'strict' => true, 'engine' => null, - 'options' => extension_loaded('pdo_mysql') ? array_filter([ - MySqlConnector::feature('SSL_CA') => env('MYSQL_ATTR_SSL_CA'), - ]) : [], + 'options' => MySqlConnector::features([ + 'ATTR_SSL_CA' => env('MYSQL_ATTR_SSL_CA'), + ]), ], 'mariadb' => [ @@ -82,9 +82,9 @@ 'prefix_indexes' => true, 'strict' => true, 'engine' => null, - 'options' => extension_loaded('pdo_mysql') ? array_filter([ - MariaDbConnector::feature('SSL_CA') => env('MYSQL_ATTR_SSL_CA'), - ]) : [], + 'options' => MariaDbConnector::features([ + 'ATTR_SSL_CA' => env('MYSQL_ATTR_SSL_CA'), + ]), ], 'pgsql' => [ diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index 6036c01e8707..193d8331eb47 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -10,14 +10,19 @@ class MySqlConnector extends Connector implements ConnectorInterface /** * Determine of PDO feature constant. * - * @param string $feature - * @return mixed + * @param array $features + * @return array */ - public static function feature(string $feature) + public static function features(array $features) { - return constant( - (string) Str::of($feature)->prepend('ATTR_')->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::') - ); + if (! extension_loaded('pdo_mysql')) { + return []; + } + + return (new Collection($features)) + ->mapWithKeys(fn ($value, $key) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::')) + ->filter() + ->all(); } /** diff --git a/src/Illuminate/Database/Connectors/SQLiteConnector.php b/src/Illuminate/Database/Connectors/SQLiteConnector.php index bf5e114db0f8..0dfd111c6c3f 100755 --- a/src/Illuminate/Database/Connectors/SQLiteConnector.php +++ b/src/Illuminate/Database/Connectors/SQLiteConnector.php @@ -10,14 +10,19 @@ class SQLiteConnector extends Connector implements ConnectorInterface /** * Determine of PDO feature constant. * - * @param string $feature - * @return mixed + * @param array $features + * @return array */ - public static function feature(string $feature) + public static function features(array $features) { - return constant( - (string) Str::of($feature)->prepend('ATTR_')->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::') - ); + if (! extension_loaded('pdo_sqlite')) { + return []; + } + + return (new Collection($features)) + ->mapWithKeys(fn ($value, $key) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::')) + ->filter() + ->all(); } /** From 57a28325f00601eb9f58f74283acc621000fb882 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 21 Oct 2025 06:17:50 +0000 Subject: [PATCH 07/11] Apply fixes from StyleCI --- src/Illuminate/Database/Connectors/MySqlConnector.php | 2 +- src/Illuminate/Database/Connectors/SQLiteConnector.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index 193d8331eb47..6e553a693930 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -20,7 +20,7 @@ public static function features(array $features) } return (new Collection($features)) - ->mapWithKeys(fn ($value, $key) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::')) + ->mapWithKeys(fn ($value, $key) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::')) ->filter() ->all(); } diff --git a/src/Illuminate/Database/Connectors/SQLiteConnector.php b/src/Illuminate/Database/Connectors/SQLiteConnector.php index 0dfd111c6c3f..f7c75583ce27 100755 --- a/src/Illuminate/Database/Connectors/SQLiteConnector.php +++ b/src/Illuminate/Database/Connectors/SQLiteConnector.php @@ -20,7 +20,7 @@ public static function features(array $features) } return (new Collection($features)) - ->mapWithKeys(fn ($value, $key) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::')) + ->mapWithKeys(fn ($value, $key) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::')) ->filter() ->all(); } From 3a781ce01e54c30a1fec0e86b79e897a47c35480 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 21 Oct 2025 15:17:26 +0800 Subject: [PATCH 08/11] wip Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Database/Connectors/MySqlConnector.php | 1 + src/Illuminate/Database/Connectors/SQLiteConnector.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index 6e553a693930..67c6cc5ddb8f 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Connectors; +use Illuminate\Support\Collection; use Illuminate\Support\Str; use PDO; diff --git a/src/Illuminate/Database/Connectors/SQLiteConnector.php b/src/Illuminate/Database/Connectors/SQLiteConnector.php index f7c75583ce27..350e47309405 100755 --- a/src/Illuminate/Database/Connectors/SQLiteConnector.php +++ b/src/Illuminate/Database/Connectors/SQLiteConnector.php @@ -3,6 +3,7 @@ namespace Illuminate\Database\Connectors; use Illuminate\Database\SQLiteDatabaseDoesNotExistException; +use Illuminate\Support\Collection; use Illuminate\Support\Str; class SQLiteConnector extends Connector implements ConnectorInterface From bd2bc1ddcca8508def3947f782da63be5559f675 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 21 Oct 2025 15:30:11 +0800 Subject: [PATCH 09/11] wip Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Database/Connectors/MySqlConnector.php | 2 +- src/Illuminate/Database/Connectors/SQLiteConnector.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index 67c6cc5ddb8f..e00f57b76e3d 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -21,7 +21,7 @@ public static function features(array $features) } return (new Collection($features)) - ->mapWithKeys(fn ($value, $key) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::')) + ->mapWithKeys(fn ($value, $feature) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::')) ->filter() ->all(); } diff --git a/src/Illuminate/Database/Connectors/SQLiteConnector.php b/src/Illuminate/Database/Connectors/SQLiteConnector.php index 350e47309405..896965b73eaa 100755 --- a/src/Illuminate/Database/Connectors/SQLiteConnector.php +++ b/src/Illuminate/Database/Connectors/SQLiteConnector.php @@ -21,7 +21,7 @@ public static function features(array $features) } return (new Collection($features)) - ->mapWithKeys(fn ($value, $key) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::')) + ->mapWithKeys(fn ($value, $feature) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::')) ->filter() ->all(); } From 2a44df7228c26a33751cd2d3904429945c11ed28 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 21 Oct 2025 15:30:36 +0800 Subject: [PATCH 10/11] wip Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Database/Connectors/MySqlConnector.php | 2 +- src/Illuminate/Database/Connectors/SQLiteConnector.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index e00f57b76e3d..74b211345dc9 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -21,7 +21,7 @@ public static function features(array $features) } return (new Collection($features)) - ->mapWithKeys(fn ($value, $feature) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::')) + ->mapWithKeys(fn ($value, $feature) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::') => $value) ->filter() ->all(); } diff --git a/src/Illuminate/Database/Connectors/SQLiteConnector.php b/src/Illuminate/Database/Connectors/SQLiteConnector.php index 896965b73eaa..cb9796de624c 100755 --- a/src/Illuminate/Database/Connectors/SQLiteConnector.php +++ b/src/Illuminate/Database/Connectors/SQLiteConnector.php @@ -21,7 +21,7 @@ public static function features(array $features) } return (new Collection($features)) - ->mapWithKeys(fn ($value, $feature) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::')) + ->mapWithKeys(fn ($value, $feature) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::') => $value) ->filter() ->all(); } From ac68a0ee395d894738f6b36085f6ac2a2f7ce9c9 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 21 Oct 2025 15:46:18 +0800 Subject: [PATCH 11/11] wip Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Database/Connectors/MySqlConnector.php | 2 +- src/Illuminate/Database/Connectors/SQLiteConnector.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index 74b211345dc9..38e7621120f0 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -21,7 +21,7 @@ public static function features(array $features) } return (new Collection($features)) - ->mapWithKeys(fn ($value, $feature) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::') => $value) + ->mapWithKeys(fn ($value, $feature) => [(string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::') => $value]) ->filter() ->all(); } diff --git a/src/Illuminate/Database/Connectors/SQLiteConnector.php b/src/Illuminate/Database/Connectors/SQLiteConnector.php index cb9796de624c..205930f13d26 100755 --- a/src/Illuminate/Database/Connectors/SQLiteConnector.php +++ b/src/Illuminate/Database/Connectors/SQLiteConnector.php @@ -21,7 +21,7 @@ public static function features(array $features) } return (new Collection($features)) - ->mapWithKeys(fn ($value, $feature) => (string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::') => $value) + ->mapWithKeys(fn ($value, $feature) => [(string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::SQLITE_' : 'Pdo\Sqlite::') => $value]) ->filter() ->all(); }