@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | /** @return $this */ |
| 13 | 13 | public function generate(): static |
| 14 | 14 | { |
| 15 | - RoutingService::getInstance()->getRoutesForModel(DocumentationPage::class)->each(function (Route $route) { |
|
| 16 | - if (! $route->getSourceModel()->get('hidden', false)) { |
|
| 15 | + RoutingService::getInstance()->getRoutesForModel(DocumentationPage::class)->each(function(Route $route) { |
|
| 16 | + if (!$route->getSourceModel()->get('hidden', false)) { |
|
| 17 | 17 | $this->items->push(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route))); |
| 18 | 18 | } |
| 19 | 19 | }); |
@@ -23,21 +23,21 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function hasGroups(): bool |
| 25 | 25 | { |
| 26 | - return $this->items->map(function (NavItem $item) { |
|
| 26 | + return $this->items->map(function(NavItem $item) { |
|
| 27 | 27 | return $item->getGroup() !== null; |
| 28 | 28 | })->contains(true); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function getGroups(): array |
| 32 | 32 | { |
| 33 | - return $this->items->map(function (NavItem $item) { |
|
| 33 | + return $this->items->map(function(NavItem $item) { |
|
| 34 | 34 | return $item->getGroup(); |
| 35 | 35 | })->unique()->toArray(); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function getItemsInGroup(?string $group): Collection |
| 39 | 39 | { |
| 40 | - return $this->items->filter(function ($item) use ($group) { |
|
| 40 | + return $this->items->filter(function($item) use ($group) { |
|
| 41 | 41 | return $item->getGroup() === $group || $item->getGroup() === Str::slug($group); |
| 42 | 42 | })->sortBy('priority')->values(); |
| 43 | 43 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | { |
| 50 | 50 | $orderIndexArray = config('docs.sidebar_order', []); |
| 51 | 51 | |
| 52 | - if (! in_array($this->identifier, $orderIndexArray)) { |
|
| 52 | + if (!in_array($this->identifier, $orderIndexArray)) { |
|
| 53 | 53 | return 500; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | */ |
| 74 | 74 | protected function parseFrontMatterMetadata(): void |
| 75 | 75 | { |
| 76 | - if (! empty($this->description)) { |
|
| 76 | + if (!empty($this->description)) { |
|
| 77 | 77 | $this->metadata['description'] = $this->description; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -172,11 +172,11 @@ discard block |
||
| 172 | 172 | { |
| 173 | 173 | $array = []; |
| 174 | 174 | |
| 175 | - if (! empty($this->canonicalUrl)) { |
|
| 175 | + if (!empty($this->canonicalUrl)) { |
|
| 176 | 176 | $array[] = Meta::link('canonical', $this->canonicalUrl); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if (! empty($this->title)) { |
|
| 179 | + if (!empty($this->title)) { |
|
| 180 | 180 | $array[] = Meta::name('twitter:title', $this->htmlTitle()); |
| 181 | 181 | $array[] = Meta::property('title', $this->htmlTitle()); |
| 182 | 182 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | public function showInNavigation(): bool |
| 205 | 205 | { |
| 206 | - return ! $this->navigation['hidden']; |
|
| 206 | + return !$this->navigation['hidden']; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | public function navigationMenuPriority(): int |
@@ -38,11 +38,11 @@ |
||
| 38 | 38 | |
| 39 | 39 | protected function makeCanonicalUrl(): ?string |
| 40 | 40 | { |
| 41 | - if (! empty($this->matter('canonicalUrl'))) { |
|
| 41 | + if (!empty($this->matter('canonicalUrl'))) { |
|
| 42 | 42 | return $this->matter('canonicalUrl'); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if (Hyde::hasSiteUrl() && ! empty($this->identifier)) { |
|
| 45 | + if (Hyde::hasSiteUrl() && !empty($this->identifier)) { |
|
| 46 | 46 | return $this->getRoute()->getQualifiedUrl(); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public static function link(string $rel, string $href, array $attr = []): string |
| 28 | 28 | { |
| 29 | - if (! $attr) { |
|
| 29 | + if (!$attr) { |
|
| 30 | 30 | return '<link rel="'.e($rel).'" href="'.e($href).'">'; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - $attributes = collect($attr)->map(function ($value, $key) { |
|
| 33 | + $attributes = collect($attr)->map(function($value, $key) { |
|
| 34 | 34 | return e($key).'="'.e($value).'"'; |
| 35 | 35 | })->implode(' '); |
| 36 | 36 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | foreach (array_reverse($meta) as $metaItem) { |
| 59 | 59 | $substring = substr($metaItem, 6, strpos($metaItem, ' content="') - 6); |
| 60 | 60 | |
| 61 | - if (! in_array($substring, $existing)) { |
|
| 61 | + if (!in_array($substring, $existing)) { |
|
| 62 | 62 | $array[] = $metaItem; |
| 63 | 63 | $existing[] = $substring; |
| 64 | 64 | } |
@@ -138,7 +138,7 @@ |
||
| 138 | 138 | |
| 139 | 139 | public function getLink(): string |
| 140 | 140 | { |
| 141 | - if (! $this->getSource()) { |
|
| 141 | + if (!$this->getSource()) { |
|
| 142 | 142 | return ''; |
| 143 | 143 | } |
| 144 | 144 | |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | { |
| 68 | 68 | $path = Hyde::path('_media/'.$this->image->getSource()); |
| 69 | 69 | |
| 70 | - if (! file_exists($path)) { |
|
| 70 | + if (!file_exists($path)) { |
|
| 71 | 71 | $this->write(' > <comment>Warning:</comment> Could not find image file at '.$path.'!'); |
| 72 | 72 | $this->write(' <fg=gray> Using default content length of 0. '.'</>'); |
| 73 | 73 | |