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 e30e35e commit e80bd43
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 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
2 changes: 0 additions & 2 deletions src/UI/Collections/Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
use MoonShine\Contracts\Core\DependencyInjection\FieldsContract;
use MoonShine\Contracts\Core\RenderableContract;
use MoonShine\Contracts\Core\TypeCasts\DataWrapperContract;
use MoonShine\Contracts\MenuManager\MenuElementContract;
use MoonShine\Contracts\UI\FieldContract;
use MoonShine\Contracts\UI\HasFieldsContract;
use MoonShine\Contracts\UI\HasReactivityContract;
use MoonShine\Core\Collections\Renderables;
use MoonShine\MenuManager\MenuGroup;
use MoonShine\UI\Contracts\FieldsWrapperContract;
use MoonShine\UI\Contracts\FileableContract;
use MoonShine\UI\Fields\ID;
Expand Down

0 comments on commit e80bd43

Please sign in to comment.