@@ -39,7 +39,7 @@ |
||
| 39 | 39 | { |
| 40 | 40 | $this->startClock(); |
| 41 | 41 | |
| 42 | - if ($output && ! $this->output) { |
|
| 42 | + if ($output && !$this->output) { |
|
| 43 | 43 | $this->setOutput($output); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | protected function isItSafeToCleanOutputDirectory(): bool |
| 34 | 34 | { |
| 35 | - if (! $this->isOutputDirectoryWhitelisted() && ! $this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
| 35 | + if (!$this->isOutputDirectoryWhitelisted() && !$this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
| 36 | 36 | $this->info('Output directory will not be emptied.'); |
| 37 | 37 | |
| 38 | 38 | return false; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | protected function generate(): void |
| 21 | 21 | { |
| 22 | - Routes::getRoutes(DocumentationPage::class)->each(function (Route $route): void { |
|
| 22 | + Routes::getRoutes(DocumentationPage::class)->each(function(Route $route): void { |
|
| 23 | 23 | if ($this->canAddRoute($route)) { |
| 24 | 24 | $this->items->put($route->getRouteKey(), NavItem::fromRoute($route)); |
| 25 | 25 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | /** @return array<string> */ |
| 35 | 35 | public function getGroups(): array |
| 36 | 36 | { |
| 37 | - return $this->items->map(function (NavItem $item): string { |
|
| 37 | + return $this->items->map(function(NavItem $item): string { |
|
| 38 | 38 | return $item->getGroup(); |
| 39 | 39 | })->unique()->toArray(); |
| 40 | 40 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | /** @return Collection<\Hyde\Framework\Features\Navigation\NavItem> */ |
| 43 | 43 | public function getItemsInGroup(?string $group): Collection |
| 44 | 44 | { |
| 45 | - return $this->items->filter(function (NavItem $item) use ($group): bool { |
|
| 45 | + return $this->items->filter(function(NavItem $item) use ($group) : bool { |
|
| 46 | 46 | return ($item->getGroup() === $group) || ($item->getGroup() === Str::slug($group)); |
| 47 | 47 | })->sortBy('navigation.priority')->values(); |
| 48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | protected function canAddRoute(Route $route): bool |
| 57 | 57 | { |
| 58 | - return parent::canAddRoute($route) && ! $route->is(DocumentationPage::homeRouteName()); |
|
| 58 | + return parent::canAddRoute($route) && !$route->is(DocumentationPage::homeRouteName()); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | private function isPageIndexPage(): bool |
@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | protected function generate(): void |
| 38 | 38 | { |
| 39 | - Routes::each(function (Route $route): void { |
|
| 39 | + Routes::each(function(Route $route): void { |
|
| 40 | 40 | if ($this->canAddRoute($route)) { |
| 41 | 41 | $this->items->put($route->getRouteKey(), NavItem::fromRoute($route)); |
| 42 | 42 | } |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | - collect(Config::getArray('hyde.navigation.custom', []))->each(function (NavItem $item): void { |
|
| 45 | + collect(Config::getArray('hyde.navigation.custom', []))->each(function(NavItem $item): void { |
|
| 46 | 46 | // Since these were added explicitly by the user, we can assume they should always be shown |
| 47 | 47 | $this->items->push($item); |
| 48 | 48 | }); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | protected function removeDuplicateItems(): void |
| 57 | 57 | { |
| 58 | - $this->items = $this->items->unique(function (NavItem $item): string { |
|
| 58 | + $this->items = $this->items->unique(function(NavItem $item): string { |
|
| 59 | 59 | // Filter using a combination of the group and label to allow duplicate labels in different groups |
| 60 | 60 | return $item->getGroup().$item->label; |
| 61 | 61 | }); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | public function generate(): static |
| 32 | 32 | { |
| 33 | - Routes::all()->each(function (Route $route): void { |
|
| 33 | + Routes::all()->each(function(Route $route): void { |
|
| 34 | 34 | $this->addRoute($route); |
| 35 | 35 | }); |
| 36 | 36 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | public function previousPageNumber(): false|int |
| 132 | 132 | { |
| 133 | - if (! $this->canNavigateBack()) { |
|
| 133 | + if (!$this->canNavigateBack()) { |
|
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | 136 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | public function nextPageNumber(): false|int |
| 141 | 141 | { |
| 142 | - if (! $this->canNavigateForward()) { |
|
| 142 | + if (!$this->canNavigateForward()) { |
|
| 143 | 143 | return false; |
| 144 | 144 | } |
| 145 | 145 | |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | public function previous(): false|string|Route |
| 150 | 150 | { |
| 151 | - if (! $this->canNavigateBack()) { |
|
| 151 | + if (!$this->canNavigateBack()) { |
|
| 152 | 152 | return false; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - if (! isset($this->routeBasename)) { |
|
| 155 | + if (!isset($this->routeBasename)) { |
|
| 156 | 156 | return $this->formatLink(-1); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -161,11 +161,11 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | public function next(): false|string|Route |
| 163 | 163 | { |
| 164 | - if (! $this->canNavigateForward()) { |
|
| 164 | + if (!$this->canNavigateForward()) { |
|
| 165 | 165 | return false; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - if (! isset($this->routeBasename)) { |
|
| 168 | + if (!isset($this->routeBasename)) { |
|
| 169 | 169 | return $this->formatLink(+1); |
| 170 | 170 | } |
| 171 | 171 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | |
| 37 | 37 | $this->displaySelections($creator); |
| 38 | 38 | |
| 39 | - if (! $this->confirm('Do you wish to continue?', true)) { |
|
| 39 | + if (!$this->confirm('Do you wish to continue?', true)) { |
|
| 40 | 40 | $this->info('Aborting.'); |
| 41 | 41 | |
| 42 | 42 | return Command::USER_EXIT; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | public function addExtension(string $extensionClassName): void |
| 89 | 89 | { |
| 90 | - if (! in_array($extensionClassName, $this->extensions)) { |
|
| 90 | + if (!in_array($extensionClassName, $this->extensions)) { |
|
| 91 | 91 | $this->extensions[] = $extensionClassName; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | public function addFeature(string $feature): static |
| 130 | 130 | { |
| 131 | - if (! in_array($feature, $this->features)) { |
|
| 131 | + if (!in_array($feature, $this->features)) { |
|
| 132 | 132 | $this->features[] = $feature; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | protected function determineIfTorchlightAttributionShouldBeInjected(): bool |
| 182 | 182 | { |
| 183 | - return ! $this->isDocumentationPage() |
|
| 183 | + return !$this->isDocumentationPage() |
|
| 184 | 184 | && Config::getBool('torchlight.attribution.enabled', true) |
| 185 | 185 | && str_contains($this->html, 'Syntax highlighted by torchlight.dev'); |
| 186 | 186 | } |
@@ -93,11 +93,11 @@ |
||
| 93 | 93 | Hyde::pathToRelative(DocumentationPage::path()), |
| 94 | 94 | ]; |
| 95 | 95 | |
| 96 | - if (! in_array($directory, $directories)) { |
|
| 96 | + if (!in_array($directory, $directories)) { |
|
| 97 | 97 | throw new Exception("Path [$this->path] is not in a valid source directory.", 400); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if (! file_exists(Hyde::path($this->path))) { |
|
| 100 | + if (!file_exists(Hyde::path($this->path))) { |
|
| 101 | 101 | throw new Exception("File [$this->path] not found.", 404); |
| 102 | 102 | } |
| 103 | 103 | } |