Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jul 19, 2024
1 parent 4c5d2af commit 7b0f4c8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Concerns/InteractsWithPublishedFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ trait InteractsWithPublishedFiles
/**
* List of existing migration files.
*
* @var array
* @var array<int, string>|null
*/
protected $cachedExistingMigrationsFiles = [];
protected $cachedExistingMigrationsFiles;

/**
* Setup Interacts with Published Files environment.
Expand Down Expand Up @@ -58,10 +58,12 @@ protected function tearDownInteractsWithPublishedFiles(): void
*/
protected function cacheExistingMigrationsFiles()
{
$this->cachedExistingMigrationsFiles = Collection::make($this->app['files']->files($this->app->databasePath('migrations')))
->filter(static function ($file) {
return Str::endsWith($file, '.php');
})->all();
if (\is_null($this->cachedExistingMigrationsFiles)) {
$this->cachedExistingMigrationsFiles = Collection::make($this->app['files']->files($this->app->databasePath('migrations')))
->filter(static function ($file) {
return Str::endsWith($file, '.php');
})->all();
}
}

/**
Expand Down

0 comments on commit 7b0f4c8

Please sign in to comment.