Skip to content

Commit

Permalink
Pint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurt Friars committed Oct 30, 2023
1 parent 9d9a10c commit 57c3b77
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Contracts/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function dataClass(): ?string;
* "menu_items.show" => MenuItemLayoutData
* "menu_items.index" => MenuItemIndexLayoutData
* "app" => AppLayoutData
*
*
* @return class-string<AbstractLayoutData>|null
*/
public static function dataClassFromKey(string $key): ?string;
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/Layoutable.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function layout(): ?Layout;

/**
* Get the layout data for the model
*
*
* @throws LayoutDataNotFoundException
*/
public function layoutData(): AbstractLayoutData;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Data/PropData.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function __get($key)
if (array_key_exists($key, $this->props)) {
return $this->props[$key];
}

return null;
}

Expand Down
13 changes: 7 additions & 6 deletions tests/Feature/LayoutsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@

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');
}

public static function from(string|Layoutable|LayoutContract $model): static
{
return new static('basic');
return new self('basic');
}
};

Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -139,7 +140,7 @@ public static function from(string|Layoutable|LayoutContract $model): static
$promotionLayout = Layout::factory()->create([
'identifier' => 'promotion',
'meta' => [
'discount' => 10
'discount' => 10,
],
]);

Expand Down

0 comments on commit 57c3b77

Please sign in to comment.