From 3de4b4bb40228a2d67a9ba61882ae28a40572cfa Mon Sep 17 00:00:00 2001 From: lee-to Date: Wed, 4 Sep 2024 11:58:02 +0000 Subject: [PATCH] Fix styling --- src/Laravel/Commands/MakeResourceCommand.php | 2 +- src/Laravel/Commands/MoonShineCommand.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Laravel/Commands/MakeResourceCommand.php b/src/Laravel/Commands/MakeResourceCommand.php index c0df23285..09a8cf8e8 100644 --- a/src/Laravel/Commands/MakeResourceCommand.php +++ b/src/Laravel/Commands/MakeResourceCommand.php @@ -6,7 +6,7 @@ use Illuminate\Contracts\Filesystem\FileNotFoundException; -use function Laravel\Prompts\{info, outro, select, text}; +use function Laravel\Prompts\{info, select, text}; use Symfony\Component\Console\Attribute\AsCommand; diff --git a/src/Laravel/Commands/MoonShineCommand.php b/src/Laravel/Commands/MoonShineCommand.php index 351318d59..ec22e5fc6 100644 --- a/src/Laravel/Commands/MoonShineCommand.php +++ b/src/Laravel/Commands/MoonShineCommand.php @@ -50,16 +50,16 @@ private static function addResourceOrPageTo(string $class, string $append, strin $content = str(file_get_contents($to)); - if($content->contains($class)) { + if ($content->contains($class)) { return; } - $tab = static fn(int $times = 1): string => str_repeat(' ', $times * 4); + $tab = static fn (int $times = 1): string => str_repeat(' ', $times * 4); $headSection = $content->before('class '); $resourcesSection = $content->betweenFirst("protected function $method(): array", '}'); - if($content->contains($use)) { + if ($content->contains($use)) { $use = ''; } @@ -70,7 +70,7 @@ private static function addResourceOrPageTo(string $class, string $append, strin ], [ $headSection->replaceLast(';', (";\nuse $namespace;" . ($use ? "\nuse $use;" : ''))), - $resourcesSection->replace("];", "{$tab()}$append,\n{$tab(2)}];")->value() + $resourcesSection->replace("];", "{$tab()}$append,\n{$tab(2)}];")->value(), ], $content->value() );