@@ -41,14 +41,14 @@ public function __construct(Disk $disk, string $fileName)
4141 $ this ->name = pathinfo ($ fileName , PATHINFO_FILENAME );
4242 }
4343
44- public function useStream ()
44+ public function useStream (): self
4545 {
4646 $ this ->useStream = true ;
4747
4848 return $ this ;
4949 }
5050
51- public function load (string $ connectionName = null , bool $ dropTables = true ): void
51+ public function load (? string $ connectionName = null , bool $ dropTables = true ): void
5252 {
5353 event (new LoadingSnapshot ($ this ));
5454
@@ -65,7 +65,7 @@ public function load(string $connectionName = null, bool $dropTables = true): vo
6565 event (new LoadedSnapshot ($ this ));
6666 }
6767
68- protected function loadAsync (string $ connectionName = null )
68+ protected function loadAsync (? string $ connectionName = null ): void
6969 {
7070 $ dbDumpContents = $ this ->disk ->get ($ this ->fileName );
7171
@@ -78,7 +78,7 @@ protected function loadAsync(string $connectionName = null)
7878
7979 protected function isASqlComment (string $ line ): bool
8080 {
81- return substr ($ line , 0 , 2 ) === '-- ' ;
81+ return str_starts_with ($ line , '-- ' ) ;
8282 }
8383
8484 protected function shouldIgnoreLine (string $ line ): bool
@@ -88,7 +88,7 @@ protected function shouldIgnoreLine(string $line): bool
8888 return empty ($ line ) || $ this ->isASqlComment ($ line );
8989 }
9090
91- protected function loadStream (string $ connectionName = null )
91+ protected function loadStream (? string $ connectionName = null ): void
9292 {
9393 LazyCollection::make (function () {
9494 $ stream = $ this ->compressionExtension === 'gz '
@@ -116,14 +116,14 @@ protected function loadStream(string $connectionName = null)
116116 break ;
117117 }
118118
119- if (substr (trim ($ statement ), - 1 , 1 ) === '; ' ) {
119+ if (str_ends_with (trim ($ statement ), '; ' ) ) {
120120 yield $ statement ;
121121 $ statement = '' ;
122122 }
123123 }
124124 }
125125
126- if (substr (trim ($ statement ), - 1 , 1 ) === '; ' ) {
126+ if (str_ends_with (trim ($ statement ), '; ' ) ) {
127127 yield $ statement ;
128128 }
129129 })->each (function (string $ statement ) use ($ connectionName ) {
@@ -150,7 +150,7 @@ public function createdAt(): Carbon
150150 return Carbon::createFromTimestamp ($ this ->disk ->lastModified ($ this ->fileName ));
151151 }
152152
153- protected function dropAllCurrentTables ()
153+ protected function dropAllCurrentTables (): void
154154 {
155155 DB ::connection (DB ::getDefaultConnection ())
156156 ->getSchemaBuilder ()
0 commit comments