@@ -18,7 +18,7 @@ class Migrate extends Processor
1818 public function handle (): void
1919 {
2020 $ this ->ensureRepository ();
21- $ this ->runActions ();
21+ $ this ->runActions ($ this -> getCompleted () );
2222 }
2323
2424 protected function ensureRepository (): void
@@ -29,10 +29,10 @@ protected function ensureRepository(): void
2929 ]);
3030 }
3131
32- protected function runActions (): void
32+ protected function runActions (array $ completed ): void
3333 {
3434 try {
35- if ($ files = $ this ->getNewFiles ()) {
35+ if ($ files = $ this ->getNewFiles ($ completed )) {
3636 $ this ->fireEvent (ActionStarted::class, 'up ' );
3737
3838 $ this ->runEach ($ files , $ this ->getBatch ());
@@ -58,22 +58,24 @@ protected function runEach(array $files, int $batch): void
5858 }
5959 }
6060
61- protected function run (string $ file , int $ batch ): void
61+ protected function run (string $ filename , int $ batch ): void
6262 {
63- $ this ->migrator ->runUp ($ file , $ batch , $ this ->options );
63+ $ this ->migrator ->runUp ($ filename , $ batch , $ this ->options );
6464 }
6565
66- protected function getNewFiles (): array
66+ protected function getNewFiles (array $ completed ): array
6767 {
68- $ completed = $ this ->repository ->getCompleted ()->pluck ('action ' )->toArray ();
69-
7068 return $ this ->getFiles (
71- filter : fn (string $ file ) => ! Str::of ($ file )->replace ('\\' , '/ ' )->contains ($ completed ),
72- path : $ this ->options ->path ,
73- fullpath: true
69+ path: $ this ->options ->path ,
70+ filter: fn (string $ file ) => ! Str::of ($ file )->replace ('\\' , '/ ' )->contains ($ completed )
7471 );
7572 }
7673
74+ protected function getCompleted (): array
75+ {
76+ return $ this ->repository ->getCompleted ()->pluck ('action ' )->toArray ();
77+ }
78+
7779 protected function getBatch (): int
7880 {
7981 return $ this ->repository ->getNextBatchNumber ();
0 commit comments