@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | /** @return $this */ |
40 | 40 | public function generate(): static |
41 | 41 | { |
42 | - Router::each(function (Route $route): void { |
|
42 | + Router::each(function(Route $route): void { |
|
43 | 43 | $this->items->push(NavItem::fromRoute($route)); |
44 | 44 | }); |
45 | 45 | |
46 | - collect(config('hyde.navigation.custom', []))->each(function (NavItem $item): void { |
|
46 | + collect(config('hyde.navigation.custom', []))->each(function(NavItem $item): void { |
|
47 | 47 | $this->items->push($item); |
48 | 48 | }); |
49 | 49 | |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | |
78 | 78 | protected function filterHiddenItems(): Collection |
79 | 79 | { |
80 | - return $this->items->reject(function (NavItem $item): bool { |
|
80 | + return $this->items->reject(function(NavItem $item): bool { |
|
81 | 81 | return $item->hidden || $this->filterDocumentationPage($item); |
82 | 82 | })->values(); |
83 | 83 | } |
84 | 84 | |
85 | 85 | protected function filterDuplicateItems(): Collection |
86 | 86 | { |
87 | - return $this->items->unique(function (NavItem $item): string { |
|
87 | + return $this->items->unique(function(NavItem $item): string { |
|
88 | 88 | return $item->resolveLink(); |
89 | 89 | }); |
90 | 90 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | $dropdownItems = collect($this->getDropdowns())->flatten()->toArray(); |
95 | 95 | |
96 | - return $this->items->reject(function (NavItem $item) use ($dropdownItems): bool { |
|
96 | + return $this->items->reject(function(NavItem $item) use ($dropdownItems): bool { |
|
97 | 97 | return in_array($item, $dropdownItems); |
98 | 98 | }); |
99 | 99 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | public function hasDropdowns(): bool |
109 | 109 | { |
110 | - if (! $this->dropdownsEnabled()) { |
|
110 | + if (!$this->dropdownsEnabled()) { |
|
111 | 111 | return false; |
112 | 112 | } |
113 | 113 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | /** @return array<string, array<NavItem>> */ |
118 | 118 | public function getDropdowns(): array |
119 | 119 | { |
120 | - if (! $this->dropdownsEnabled()) { |
|
120 | + if (!$this->dropdownsEnabled()) { |
|
121 | 121 | throw new BadMethodCallException('Dropdowns are not enabled. Enable it by setting `hyde.navigation.subdirectories` to `dropdown`.'); |
122 | 122 | } |
123 | 123 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | protected static function canBeInDropdown(NavItem $item): bool |
128 | 128 | { |
129 | - return ($item->getGroup() !== null) && ! in_array($item->route->getPageClass(), [DocumentationPage::class, MarkdownPost::class]); |
|
129 | + return ($item->getGroup() !== null) && !in_array($item->route->getPageClass(), [DocumentationPage::class, MarkdownPost::class]); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | protected static function dropdownsEnabled(): bool |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | /** @var \Hyde\Framework\Features\Navigation\NavItem $item */ |
142 | 142 | foreach ($this->items as $item) { |
143 | - if (! $this->canBeInDropdown($item)) { |
|
143 | + if (!$this->canBeInDropdown($item)) { |
|
144 | 144 | continue; |
145 | 145 | } |
146 | 146 |