Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to authored and github-actions[bot] committed Sep 4, 2024
1 parent 910dabb commit 3de4b4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Laravel/Commands/MakeResourceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions src/Laravel/Commands/MoonShineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
}

Expand All @@ -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()
);
Expand Down

0 comments on commit 3de4b4b

Please sign in to comment.