diff --git a/src/Contracts/Layout.php b/src/Contracts/Layout.php index ae6ff65..4a5265a 100644 --- a/src/Contracts/Layout.php +++ b/src/Contracts/Layout.php @@ -36,7 +36,7 @@ public function dataClass(): ?string; * "menu_items.show" => MenuItemLayoutData * "menu_items.index" => MenuItemIndexLayoutData * "app" => AppLayoutData - * + * * @return class-string|null */ public static function dataClassFromKey(string $key): ?string; diff --git a/src/Contracts/Layoutable.php b/src/Contracts/Layoutable.php index f862320..2773e03 100644 --- a/src/Contracts/Layoutable.php +++ b/src/Contracts/Layoutable.php @@ -14,7 +14,7 @@ public function layout(): ?Layout; /** * Get the layout data for the model - * + * * @throws LayoutDataNotFoundException */ public function layoutData(): AbstractLayoutData; @@ -44,7 +44,7 @@ public static function indexLayout(): ?Layout; /** * Allow the model's class to define a layout for its index - * + * * @throws LayoutDataNotFoundException */ public static function indexLayoutData(): AbstractLayoutData; diff --git a/src/Data/PropData.php b/src/Data/PropData.php index 02ff2de..f9270b2 100644 --- a/src/Data/PropData.php +++ b/src/Data/PropData.php @@ -102,7 +102,7 @@ public function __get($key) if (array_key_exists($key, $this->props)) { return $this->props[$key]; } - + return null; } diff --git a/tests/Feature/LayoutsTest.php b/tests/Feature/LayoutsTest.php index 7e37e75..5dfdf9b 100644 --- a/tests/Feature/LayoutsTest.php +++ b/tests/Feature/LayoutsTest.php @@ -20,7 +20,8 @@ describe('it resolves data classes correctly', function () { it('returns empty prop data on basic layout data', function () { - $data = new class extends AbstractLayoutData { + $data = new class extends AbstractLayoutData + { public function __construct() { parent::__construct('basic'); @@ -28,7 +29,7 @@ public function __construct() public static function from(string|Layoutable|LayoutContract $model): static { - return new static('basic'); + return new self('basic'); } }; @@ -94,15 +95,15 @@ public static function from(string|Layoutable|LayoutContract $model): static $app = Layout::factory()->create([ 'identifier' => 'app', ]); - + $header = Menu::factory() ->has(MenuItem::factory()->count(5), 'items') ->create(); - + $footer = Menu::factory() ->has(MenuItem::factory()->count(3), 'items') ->create(); - + $app->menus()->sync([ $header->id => ['key' => 'header'], $footer->id => ['key' => 'footer'], @@ -139,7 +140,7 @@ public static function from(string|Layoutable|LayoutContract $model): static $promotionLayout = Layout::factory()->create([ 'identifier' => 'promotion', 'meta' => [ - 'discount' => 10 + 'discount' => 10, ], ]);