Skip to content

Commit 0ba4ed4

Browse files
authored
Added PDO subclass support for PHP 8.4 (#7019)
1 parent 5875777 commit 0ba4ed4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Connectors/Connector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ public function setDefaultOptions(array $options)
104104
*/
105105
protected function createPdoConnection($dsn, $username, $password, $options)
106106
{
107-
return new PDO($dsn, $username, $password, $options);
107+
return PHP_VERSION_ID < 80400
108+
? new PDO($dsn, $username, $password, $options)
109+
: PDO::connect($dsn, $username, $password, $options); /* @phpstan-ignore staticMethod.notFound (PHP 8.4) */
108110
}
109111

110112
/**

0 commit comments

Comments
 (0)