@@ -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; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function mediaLink(string $destination, bool $validate = false): string |
| 91 | 91 | { |
| 92 | - if ($validate && ! file_exists($sourcePath = "{$this->kernel->getMediaDirectory()}/$destination")) { |
|
| 92 | + if ($validate && !file_exists($sourcePath = "{$this->kernel->getMediaDirectory()}/$destination")) { |
|
| 93 | 93 | throw new FileNotFoundException($sourcePath); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function hasSiteUrl(): bool |
| 125 | 125 | { |
| 126 | - return ! blank(Config::getNullableString('hyde.url')); |
|
| 126 | + return !blank(Config::getNullableString('hyde.url')); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function check_documentation_site_has_an_index_page(Result $result): Result |
| 77 | 77 | { |
| 78 | - if (! Features::hasDocumentationPages()) { |
|
| 78 | + if (!Features::hasDocumentationPages()) { |
|
| 79 | 79 | return $result->skip('Does documentation site have an index page?') |
| 80 | 80 | ->withTip('Skipped because: The documentation page feature is disabled in config'); |
| 81 | 81 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | public function check_a_torchlight_api_token_is_set(Result $result): Result |
| 123 | 123 | { |
| 124 | - if (! Features::enabled(Features::torchlight())) { |
|
| 124 | + if (!Features::enabled(Features::torchlight())) { |
|
| 125 | 125 | return $result->skip('Check a Torchlight API token is set') |
| 126 | 126 | ->withTip('Torchlight is an API for code syntax highlighting. You can enable it in the Hyde config.'); |
| 127 | 127 | } |
@@ -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 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $selected = $this->parseSelection(); |
| 56 | 56 | |
| 57 | - if (! $this->canExistingFileBeOverwritten()) { |
|
| 57 | + if (!$this->canExistingFileBeOverwritten()) { |
|
| 58 | 58 | $this->error('A modified index.blade.php file already exists. Use --force to overwrite.'); |
| 59 | 59 | |
| 60 | 60 | return 409; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | Artisan::call('vendor:publish', [ |
| 66 | 66 | '--tag' => $this->options[$selected]['group'] ?? $selected, |
| 67 | 67 | '--force' => true, // Todo add force state dynamically depending on existing file state |
| 68 | - ], ! $tagExists ? $this->output : null); |
|
| 68 | + ], !$tagExists ? $this->output : null); |
|
| 69 | 69 | |
| 70 | 70 | if ($tagExists) { |
| 71 | 71 | $this->infoComment("Published page [$selected]"); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | protected function formatPublishableChoices(): array |
| 94 | 94 | { |
| 95 | - return $this->getTemplateOptions()->map(function (array $option, string $key): string { |
|
| 95 | + return $this->getTemplateOptions()->map(function(array $option, string $key): string { |
|
| 96 | 96 | return "<comment>$key</comment>: {$option['description']}"; |
| 97 | 97 | })->values()->toArray(); |
| 98 | 98 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | return true; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if (! file_exists(BladePage::path('index.blade.php'))) { |
|
| 116 | + if (!file_exists(BladePage::path('index.blade.php'))) { |
|
| 117 | 117 | return true; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -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 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | protected function runDiscovery(): void |
| 34 | 34 | { |
| 35 | - $this->kernel->files()->each(function (SourceFile $file): void { |
|
| 35 | + $this->kernel->files()->each(function(SourceFile $file): void { |
|
| 36 | 36 | $this->addPage($this->parsePage($file->pageClass, $file->getPath())); |
| 37 | 37 | }); |
| 38 | 38 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function getPages(?string $pageClass = null): PageCollection |
| 64 | 64 | { |
| 65 | - return $pageClass ? $this->filter(function (HydePage $page) use ($pageClass): bool { |
|
| 65 | + return $pageClass ? $this->filter(function(HydePage $page) use ($pageClass) : bool { |
|
| 66 | 66 | return $page instanceof $pageClass; |
| 67 | 67 | }) : $this; |
| 68 | 68 | } |