File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,10 @@ final class PostgresConfig implements DatabaseConfig
1313{
1414 public string $ dsn {
1515 get => sprintf (
16- 'pgsql:host=%s;port=%s;dbname=%s;user=%s;password=%s ' ,
16+ 'pgsql:host=%s;port=%s;dbname=%s ' ,
1717 $ this ->host ,
1818 $ this ->port ,
1919 $ this ->database ,
20- $ this ->username ,
21- $ this ->password ,
2220 );
2321 }
2422
@@ -34,7 +32,7 @@ public function __construct(
3432 #[SensitiveParameter]
3533 public string $ username = 'postgres ' ,
3634 #[SensitiveParameter]
37- public string $ password = '' ,
35+ public ? string $ password = null ,
3836 #[SensitiveParameter]
3937 public string $ database = 'app ' ,
4038 public NamingStrategy $ namingStrategy = new PluralizedSnakeCaseStrategy (),
Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ public function connect(): void
9898 return ;
9999 }
100100
101- $ this ->pdo = new PDO ($ this ->config ->dsn );
101+ $ this ->pdo = new PDO (
102+ dsn: $ this ->config ->dsn ,
103+ username: $ this ->config ->username ,
104+ password: $ this ->config ->password ,
105+ );
102106 }
103107}
You can’t perform that action at this time.
0 commit comments