Skip to content

Commit 03a1071

Browse files
authored
Fix optional parameters
1 parent e67040a commit 03a1071

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Codeception/Lib/Driver/Db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static function getProvider($dsn): string
7878
* @see https://www.php.net/manual/en/pdo.construct.php
7979
* @see https://www.php.net/manual/de/ref.pdo-mysql.php#pdo-mysql.constants
8080
*/
81-
public function __construct(string $dsn, string $user, string $password, array $options = null)
81+
public function __construct(string $dsn, string $user = null, string $password = null, array $options = null)
8282
{
8383
$this->dbh = new PDO($dsn, $user, $password, $options);
8484
$this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

src/Codeception/Lib/Driver/Sqlite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Sqlite extends Db
1414

1515
protected string $filename = '';
1616

17-
public function __construct(string $dsn, string $user, string $password, array $options = null)
17+
public function __construct(string $dsn, string $user = null, string $password = null, array $options = null)
1818
{
1919
$filename = substr($dsn, 7);
2020
if ($filename === ':memory:') {

0 commit comments

Comments
 (0)