Skip to content

Commit 8a4a52e

Browse files
ju5tJubeki
andauthored
[11.x] Add PDO subclass support for PHP 8.4 (#52538)
* feat: add PDO subclass support for PHP 8.4 * chore: remove duplicate parentheses Co-authored-by: Julius Kiekbusch <[email protected]> * chore: ignore error as method is available in 8.4 --------- Co-authored-by: Julius Kiekbusch <[email protected]>
1 parent cbaca59 commit 8a4a52e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Database/Connectors/Connector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public function createConnection($dsn, array $config, array $options)
6262
*/
6363
protected function createPdoConnection($dsn, $username, $password, $options)
6464
{
65-
return new PDO($dsn, $username, $password, $options);
65+
return version_compare(phpversion(), '8.4.0', '<')
66+
? new PDO($dsn, $username, $password, $options)
67+
: PDO::connect($dsn, $username, $password, $options); /** @phpstan-ignore staticMethod.notFound (PHP 8.4) */
6668
}
6769

6870
/**

0 commit comments

Comments
 (0)