From 39611888ead4a0ab834af75081ae988a35a44081 Mon Sep 17 00:00:00 2001 From: David Flores Date: Thu, 20 Jan 2022 18:09:34 -0600 Subject: [PATCH 1/4] If migration folder doesn't exist in phar binary When you create a phar if you don't include a migration file the folder is not included in your distribution binary, this cause an error when you run the `migration` command --- src/Components/Database/Migrator.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Components/Database/Migrator.php b/src/Components/Database/Migrator.php index a958207e..6cbb167f 100644 --- a/src/Components/Database/Migrator.php +++ b/src/Components/Database/Migrator.php @@ -42,8 +42,12 @@ function ($path) { ->files() ->name(basename($path)); } else { - $finder = (new Finder)->in([$path]) - ->files(); + try { + $finder = (new Finder)->in([$path]) + ->files(); + } catch (DirectoryNotFoundException) { + return []; + } } return collect($finder) From 257801d408e1820e2e2b938034d45cb53d136d78 Mon Sep 17 00:00:00 2001 From: David Flores Date: Sat, 22 Jan 2022 00:34:30 -0600 Subject: [PATCH 2/4] Update Migrator.php --- src/Components/Database/Migrator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Database/Migrator.php b/src/Components/Database/Migrator.php index 6cbb167f..b4c011a7 100644 --- a/src/Components/Database/Migrator.php +++ b/src/Components/Database/Migrator.php @@ -45,7 +45,7 @@ function ($path) { try { $finder = (new Finder)->in([$path]) ->files(); - } catch (DirectoryNotFoundException) { + } catch (DirectoryNotFoundException $e) { return []; } } From e0df2f04698ff871b57ae0ee9c51b26e84989323 Mon Sep 17 00:00:00 2001 From: David Flores Date: Sat, 22 Jan 2022 00:35:14 -0600 Subject: [PATCH 3/4] Update Migrator.php --- src/Components/Database/Migrator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Components/Database/Migrator.php b/src/Components/Database/Migrator.php index b4c011a7..e357a09a 100644 --- a/src/Components/Database/Migrator.php +++ b/src/Components/Database/Migrator.php @@ -14,6 +14,7 @@ namespace LaravelZero\Framework\Components\Database; use function collect; +use Symfony\Component\Finder\Exception\DirectoryNotFoundException; use Illuminate\Database\Migrations\Migrator as BaseMigrator; use Illuminate\Support\Str; use SplFileInfo; From c771ee41a4284f6c5939487922ead83212b52be0 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Wed, 26 Jan 2022 16:24:00 +0000 Subject: [PATCH 4/4] style: apply fixes from StyleCI --- src/Components/Database/Migrator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Database/Migrator.php b/src/Components/Database/Migrator.php index e357a09a..258b242d 100644 --- a/src/Components/Database/Migrator.php +++ b/src/Components/Database/Migrator.php @@ -14,10 +14,10 @@ namespace LaravelZero\Framework\Components\Database; use function collect; -use Symfony\Component\Finder\Exception\DirectoryNotFoundException; use Illuminate\Database\Migrations\Migrator as BaseMigrator; use Illuminate\Support\Str; use SplFileInfo; +use Symfony\Component\Finder\Exception\DirectoryNotFoundException; use Symfony\Component\Finder\Finder; /**