@@ -31,7 +31,7 @@ class Db
31
31
*/
32
32
protected array $ primaryKeys = [];
33
33
34
- public static function connect (string $ dsn , string $ user = null , string $ password = null , array $ options = null ): PDO
34
+ public static function connect (string $ dsn , ? string $ user = null , ? string $ password = null , ? array $ options = null ): PDO
35
35
{
36
36
$ dbh = new PDO ($ dsn , $ user , $ password , $ options );
37
37
$ dbh ->setAttribute (PDO ::ATTR_ERRMODE , PDO ::ERRMODE_EXCEPTION );
@@ -47,7 +47,7 @@ public static function connect(string $dsn, string $user = null, string $passwor
47
47
*
48
48
* @return Db|SqlSrv|MySql|Oci|PostgreSql|Sqlite
49
49
*/
50
- public static function create (string $ dsn , string $ user = null , string $ password = null , array $ options = null ): Db
50
+ public static function create (string $ dsn , ? string $ user = null , ? string $ password = null , ? array $ options = null ): Db
51
51
{
52
52
$ provider = self ::getProvider ($ dsn );
53
53
@@ -78,7 +78,7 @@ public static function getProvider($dsn): string
78
78
* @see https://www.php.net/manual/en/pdo.construct.php
79
79
* @see https://www.php.net/manual/de/ref.pdo-mysql.php#pdo-mysql.constants
80
80
*/
81
- public function __construct (string $ dsn , string $ user = null , string $ password = null , array $ options = null )
81
+ public function __construct (string $ dsn , ? string $ user = null , ? string $ password = null , ? array $ options = null )
82
82
{
83
83
$ this ->dbh = new PDO ($ dsn , $ user , $ password , $ options );
84
84
$ this ->dbh ->setAttribute (PDO ::ATTR_ERRMODE , PDO ::ERRMODE_EXCEPTION );
0 commit comments