@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | /** @return $this */ |
33 | 33 | public function generate(): static |
34 | 34 | { |
35 | - Router::each(function (Route $route) { |
|
35 | + Router::each(function(Route $route) { |
|
36 | 36 | $this->items->push(NavItem::fromRoute($route)); |
37 | 37 | }); |
38 | 38 | |
39 | - collect(config('hyde.navigation.custom', []))->each(function (NavItem $item) { |
|
39 | + collect(config('hyde.navigation.custom', []))->each(function(NavItem $item) { |
|
40 | 40 | $this->items->push($item); |
41 | 41 | }); |
42 | 42 | |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | |
63 | 63 | protected function filterHiddenItems(): Collection |
64 | 64 | { |
65 | - return $this->items->reject(function (NavItem $item) { |
|
65 | + return $this->items->reject(function(NavItem $item) { |
|
66 | 66 | return $item->hidden || $this->filterDocumentationPage($item); |
67 | 67 | })->values(); |
68 | 68 | } |
69 | 69 | |
70 | 70 | protected function filterDuplicateItems(): Collection |
71 | 71 | { |
72 | - return $this->items->unique(function (NavItem $item) { |
|
72 | + return $this->items->unique(function(NavItem $item) { |
|
73 | 73 | return $item->resolveLink(); |
74 | 74 | }); |
75 | 75 | } |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | /** @return $this */ |
19 | 19 | public function generate(): static |
20 | 20 | { |
21 | - Router::getRoutes(DocumentationPage::class)->each(function (Route $route) { |
|
22 | - $this->items->push(tap(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route)), function (NavItem $item) { |
|
21 | + Router::getRoutes(DocumentationPage::class)->each(function(Route $route) { |
|
22 | + $this->items->push(tap(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route)), function(NavItem $item) { |
|
23 | 23 | $item->label = $item->route->getPage()->get('navigation.label'); |
24 | 24 | })); |
25 | 25 | }); |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | |
35 | 35 | public function getGroups(): array |
36 | 36 | { |
37 | - return $this->items->map(function (NavItem $item) { |
|
37 | + return $this->items->map(function(NavItem $item) { |
|
38 | 38 | return $item->getGroup(); |
39 | 39 | })->unique()->toArray(); |
40 | 40 | } |
41 | 41 | |
42 | 42 | public function getItemsInGroup(?string $group): Collection |
43 | 43 | { |
44 | - return $this->items->filter(function ($item) use ($group) { |
|
44 | + return $this->items->filter(function($item) use ($group) { |
|
45 | 45 | return $item->getGroup() === $group || $item->getGroup() === Str::slug($group); |
46 | 46 | })->sortBy('navigation.priority')->values(); |
47 | 47 | } |
@@ -53,6 +53,6 @@ discard block |
||
53 | 53 | |
54 | 54 | protected function filterDocumentationPage(NavItem $item): bool |
55 | 55 | { |
56 | - return ! parent::filterDocumentationPage($item); |
|
56 | + return !parent::filterDocumentationPage($item); |
|
57 | 57 | } |
58 | 58 | } |
@@ -70,11 +70,11 @@ |
||
70 | 70 | */ |
71 | 71 | public static function getSourceFileListForModel(string $model): array |
72 | 72 | { |
73 | - if (! class_exists($model) || ! is_subclass_of($model, HydePage::class)) { |
|
73 | + if (!class_exists($model) || !is_subclass_of($model, HydePage::class)) { |
|
74 | 74 | throw new UnsupportedPageTypeException($model); |
75 | 75 | } |
76 | 76 | |
77 | - return FileCollection::getSourceFiles($model)->flatten()->map(function (File $file) use ($model): string { |
|
77 | + return FileCollection::getSourceFiles($model)->flatten()->map(function(File $file) use ($model): string { |
|
78 | 78 | return static::pathToIdentifier($model, $file->withoutDirectoryPrefix()); |
79 | 79 | })->toArray(); |
80 | 80 | } |