@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | { |
12 | 12 | public function generate(): self |
13 | 13 | { |
14 | - RoutingService::getInstance()->getRoutesForModel(DocumentationPage::class)->each(function (Route $route) { |
|
14 | + RoutingService::getInstance()->getRoutesForModel(DocumentationPage::class)->each(function(Route $route) { |
|
15 | 15 | $this->items->push(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route))); |
16 | 16 | }); |
17 | 17 | |
@@ -20,28 +20,28 @@ discard block |
||
20 | 20 | |
21 | 21 | public function hasGroups(): bool |
22 | 22 | { |
23 | - return $this->items->map(function (NavItem $item) { |
|
23 | + return $this->items->map(function(NavItem $item) { |
|
24 | 24 | return $item->getGroup() !== null; |
25 | 25 | })->contains(true); |
26 | 26 | } |
27 | 27 | |
28 | 28 | public function getGroups(): array |
29 | 29 | { |
30 | - return $this->items->map(function (NavItem $item) { |
|
30 | + return $this->items->map(function(NavItem $item) { |
|
31 | 31 | return $item->getGroup(); |
32 | 32 | })->unique()->toArray(); |
33 | 33 | } |
34 | 34 | |
35 | 35 | public function getItemsInGroup(?string $group): Collection |
36 | 36 | { |
37 | - return $this->items->filter(function ($item) use ($group) { |
|
37 | + return $this->items->filter(function($item) use ($group) { |
|
38 | 38 | return $item->getGroup() === $group || $item->getGroup() === Str::slug($group); |
39 | 39 | })->sortBy('priority')->values(); |
40 | 40 | } |
41 | 41 | |
42 | 42 | protected function filterHiddenItems(): Collection |
43 | 43 | { |
44 | - return $this->items->reject(function (NavItem $item) { |
|
44 | + return $this->items->reject(function(NavItem $item) { |
|
45 | 45 | return $item->route->getSourceModel()->matter('hidden', false) || ($item->route->getRouteKey() === 'docs/index'); |
46 | 46 | })->values(); |
47 | 47 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $orderIndexArray = config('docs.sidebar_order', []); |
57 | 57 | |
58 | - if (! in_array($slug, $orderIndexArray)) { |
|
58 | + if (!in_array($slug, $orderIndexArray)) { |
|
59 | 59 | return 500; |
60 | 60 | } |
61 | 61 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public static function getSourceFileListForModel(string $model): array|false |
30 | 30 | { |
31 | - if (! class_exists($model) || ! is_subclass_of($model, AbstractPage::class)) { |
|
31 | + if (!class_exists($model) || !is_subclass_of($model, AbstractPage::class)) { |
|
32 | 32 | return false; |
33 | 33 | } |
34 | 34 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $files = []; |
38 | 38 | foreach (glob(Hyde::path($model::qualifyBasename('{*,**/*}')), GLOB_BRACE) as $filepath) { |
39 | - if (! str_starts_with(basename($filepath), '_')) { |
|
39 | + if (!str_starts_with(basename($filepath), '_')) { |
|
40 | 40 | $files[] = static::formatSlugForModel($model, $filepath); |
41 | 41 | } |
42 | 42 | } |