@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public static function get(string $filename, ?string $default = null): ?string |
| 52 | 52 | { |
| 53 | - return static::getInclude(fn (string $contents): string => $contents, $filename, $default); |
|
| 53 | + return static::getInclude(fn (string $contents) : string => $contents, $filename, $default); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | protected static function getFileContents(string $path): ?string |
| 111 | 111 | { |
| 112 | - if (! Filesystem::exists($path)) { |
|
| 112 | + if (!Filesystem::exists($path)) { |
|
| 113 | 113 | return null; |
| 114 | 114 | } |
| 115 | 115 | |
@@ -234,7 +234,7 @@ |
||
| 234 | 234 | |
| 235 | 235 | protected function ensureInstanceIsBooted(string $property): void |
| 236 | 236 | { |
| 237 | - if (! isset($this->$property)) { |
|
| 237 | + if (!isset($this->$property)) { |
|
| 238 | 238 | $this->boot(); |
| 239 | 239 | } |
| 240 | 240 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | private function isNonDocumentationPageInHiddenSubdirectory(): bool |
| 149 | 149 | { |
| 150 | - return ! $this->isInstanceOf(DocumentationPage::class) |
|
| 150 | + return !$this->isInstanceOf(DocumentationPage::class) |
|
| 151 | 151 | && $this->pageIsInSubdirectory() |
| 152 | 152 | && $this->getSubdirectoryConfiguration() === 'hidden' |
| 153 | 153 | && basename($this->identifier) !== 'index'; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | $pageKey = $this->{$pageKeyName}; |
| 230 | 230 | |
| 231 | 231 | // Check if the config entry is a flat array or a keyed array. |
| 232 | - if (! array_key_exists($pageKey, $config)) { |
|
| 232 | + if (!array_key_exists($pageKey, $config)) { |
|
| 233 | 233 | // Adding an offset makes so that pages with a front matter priority, or |
| 234 | 234 | // explicit keyed priority selection that is lower can be shown first. |
| 235 | 235 | // This is all to make it easier to mix ways of adding priorities. |
@@ -245,11 +245,11 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | private function checkFilePrefixForOrder(): ?int |
| 247 | 247 | { |
| 248 | - if (! $this->isInstanceOf(DocumentationPage::class)) { |
|
| 248 | + if (!$this->isInstanceOf(DocumentationPage::class)) { |
|
| 249 | 249 | return null; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - if (! NumericalPageOrderingHelper::hasNumericalPrefix($this->identifier)) { |
|
| 252 | + if (!NumericalPageOrderingHelper::hasNumericalPrefix($this->identifier)) { |
|
| 253 | 253 | return null; |
| 254 | 254 | } |
| 255 | 255 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | |
| 286 | 286 | protected function invert(?bool $value): ?bool |
| 287 | 287 | { |
| 288 | - return $value === null ? null : ! $value; |
|
| 288 | + return $value === null ? null : !$value; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | protected function offset(?int $value, int $offset): ?int |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | public function addExtension(string $extensionClassName): void |
| 101 | 101 | { |
| 102 | - if (! in_array($extensionClassName, $this->extensions)) { |
|
| 102 | + if (!in_array($extensionClassName, $this->extensions)) { |
|
| 103 | 103 | $this->extensions[] = $extensionClassName; |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | public function addFeature(string $feature): static |
| 142 | 142 | { |
| 143 | - if (! in_array($feature, $this->features)) { |
|
| 143 | + if (!in_array($feature, $this->features)) { |
|
| 144 | 144 | $this->features[] = $feature; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | protected function determineIfTorchlightAttributionShouldBeInjected(): bool |
| 174 | 174 | { |
| 175 | - return ! $this->isDocumentationPage() |
|
| 176 | - && ! (isset($this->pageClass) && $this->pageClass === MarkdownDocument::class) |
|
| 175 | + return !$this->isDocumentationPage() |
|
| 176 | + && !(isset($this->pageClass) && $this->pageClass === MarkdownDocument::class) |
|
| 177 | 177 | && Config::getBool('torchlight.attribution.enabled', true) |
| 178 | 178 | && str_contains($this->html, 'Syntax highlighted by torchlight.dev'); |
| 179 | 179 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | public function check_documentation_site_has_an_index_page(Result $result): Result |
| 81 | 81 | { |
| 82 | - if (! Features::hasDocumentationPages()) { |
|
| 82 | + if (!Features::hasDocumentationPages()) { |
|
| 83 | 83 | return $result->skip('Does documentation site have an index page?') |
| 84 | 84 | ->withTip('Skipped because: The documentation page feature is disabled in config'); |
| 85 | 85 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | public function check_a_torchlight_api_token_is_set(Result $result): Result |
| 127 | 127 | { |
| 128 | - if (! Features::has(Feature::Torchlight)) { |
|
| 128 | + if (!Features::has(Feature::Torchlight)) { |
|
| 129 | 129 | return $result->skip('Check a Torchlight API token is set') |
| 130 | 130 | ->withTip('Torchlight is an API for code syntax highlighting. You can enable it in the Hyde config.'); |
| 131 | 131 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function compileStaticPages(): void |
| 42 | 42 | { |
| 43 | - collect($this->getPageTypes())->each(function (string $pageClass): void { |
|
| 43 | + collect($this->getPageTypes())->each(function(string $pageClass): void { |
|
| 44 | 44 | $this->compilePagesForClass($pageClass); |
| 45 | 45 | }); |
| 46 | 46 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $collection = Routes::getRoutes($pageClass); |
| 56 | 56 | |
| 57 | - $this->withProgressBar($collection, function (Route $route): void { |
|
| 57 | + $this->withProgressBar($collection, function(Route $route): void { |
|
| 58 | 58 | StaticPageBuilder::handle($route->getPage()); |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | /** @return array<class-string<\Hyde\Pages\Concerns\HydePage>> */ |
| 74 | 74 | protected function getPageTypes(): array |
| 75 | 75 | { |
| 76 | - return Hyde::pages()->map(function (HydePage $page): string { |
|
| 76 | + return Hyde::pages()->map(function(HydePage $page): string { |
|
| 77 | 77 | if ($page instanceof InMemoryPage) { |
| 78 | 78 | return InMemoryPage::class; |
| 79 | 79 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | { |
| 30 | 30 | public function generate(): static |
| 31 | 31 | { |
| 32 | - Routes::all()->each(function (Route $route): void { |
|
| 32 | + Routes::all()->each(function(Route $route): void { |
|
| 33 | 33 | $this->addRoute($route); |
| 34 | 34 | }); |
| 35 | 35 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | public static function enabled(): bool |
| 36 | 36 | { |
| 37 | - return Config::getBool('docs.create_search_page', true) && ! static::anotherSearchPageExists(); |
|
| 37 | + return Config::getBool('docs.create_search_page', true) && !static::anotherSearchPageExists(); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public static function routeKey(): string |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | public static function extractDate(string $filepath): DateTimeInterface |
| 29 | 29 | { |
| 30 | - if (! preg_match(static::DATE_PATTERN, basename($filepath), $matches)) { |
|
| 30 | + if (!preg_match(static::DATE_PATTERN, basename($filepath), $matches)) { |
|
| 31 | 31 | throw new InvalidArgumentException('The given filepath does not contain a valid ISO 8601 date prefix.'); |
| 32 | 32 | } |
| 33 | 33 | |