@@ -22,15 +22,14 @@ public function dump(): string
2222 throw new BinaryNotFoundException ($ this ->command . ' was not found ' );
2323 }
2424
25- $ config = $ this ->getConfig ();
2625 $ passFile = $ this ->writePassFile ();
2726
2827 $ command = [
2928 'PGPASSFILE= ' . $ passFile ,
3029 $ this ->command ,
31- '--host= ' . ($ config ['host ' ] ?? 'localhost ' ),
32- '--username= ' . ($ config ['username ' ] ?? '' ),
33- '--dbname=" ' . ($ config ['database ' ] ?? '' ) . '" ' ,
30+ '--host= ' . ($ this -> config ['host ' ] ?? 'localhost ' ),
31+ '--username= ' . ($ this -> config ['username ' ] ?? '' ),
32+ '--dbname=" ' . ($ this -> config ['database ' ] ?? '' ) . '" ' ,
3433 ];
3534 if ($ this ->isDataOnly ()) {
3635 $ command [] = '--data-only ' ;
@@ -42,7 +41,7 @@ public function dump(): string
4241 $ output = $ process ->getOutput ();
4342 $ error = $ process ->getErrorOutput ();
4443
45- if (strpos ($ error , 'server version mismatch ' ) !== false ) {
44+ if (str_contains ($ error , 'server version mismatch ' )) {
4645 throw new VersionMismatchException ();
4746 }
4847
@@ -60,15 +59,13 @@ public function dump(): string
6059 */
6160 private function writePassFile (): string
6261 {
63- $ config = $ this ->getConfig ();
64-
6562 $ passwordParts = [
66- empty ($ config ['host ' ]) ? 'localhost ' : $ config ['host ' ],
67- empty ($ config ['port ' ]) ? '5432 ' : $ config ['port ' ],
63+ empty ($ this -> config ['host ' ]) ? 'localhost ' : $ this -> config ['host ' ],
64+ empty ($ this -> config ['port ' ]) ? '5432 ' : $ this -> config ['port ' ],
6865 // Database
6966 '* ' ,
70- $ config ['username ' ],
71- $ config ['password ' ],
67+ $ this -> config ['username ' ],
68+ $ this -> config ['password ' ],
7269 ];
7370
7471 // Escape colon and backslash characters in entries.
0 commit comments