@@ -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; |
@@ -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; |
@@ -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 | } |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | |
| 120 | 120 | protected function processInput(): static |
| 121 | 121 | { |
| 122 | - $this->output = implode("\n", array_map(function (string $line): string { |
|
| 122 | + $this->output = implode("\n", array_map(function(string $line): string { |
|
| 123 | 123 | return $this->expandShortcode($line); |
| 124 | 124 | }, explode("\n", $this->input))); |
| 125 | 125 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | /** @return \Hyde\Foundation\Kernel\PageCollection<\Hyde\Pages\MarkdownPost> */ |
| 36 | 36 | public static function getLatestPosts(): PageCollection |
| 37 | 37 | { |
| 38 | - return static::all()->sortByDesc(function (self $post): int { |
|
| 38 | + return static::all()->sortByDesc(function(self $post): int { |
|
| 39 | 39 | return $post->date?->dateTimeObject->getTimestamp() ?? 0; |
| 40 | 40 | }); |
| 41 | 41 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $app = Container::getInstance(); |
| 27 | 27 | |
| 28 | - if (! $app->bound(self::class)) { |
|
| 28 | + if (!$app->bound(self::class)) { |
|
| 29 | 29 | $app->singleton(self::class); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | // Reject any metadata from the global metadata bag that is already present in the page metadata bag. |
| 53 | 53 | |
| 54 | 54 | foreach (['links', 'metadata', 'properties', 'generics'] as $type) { |
| 55 | - $global->$type = array_filter((array) $global->$type, fn (Element $element): bool => ! in_array($element->uniqueKey(), |
|
| 55 | + $global->$type = array_filter((array) $global->$type, fn (Element $element): bool => !in_array($element->uniqueKey(), |
|
| 56 | 56 | array_map(fn (Element $element): string => $element->uniqueKey(), (array) $page->metadata->$type) |
| 57 | 57 | )); |
| 58 | 58 | } |
@@ -233,14 +233,14 @@ |
||
| 233 | 233 | |
| 234 | 234 | protected function parseFieldData(array $fields): Collection |
| 235 | 235 | { |
| 236 | - return Collection::make($fields)->map(function (array $data): PublicationFieldDefinition { |
|
| 236 | + return Collection::make($fields)->map(function(array $data): PublicationFieldDefinition { |
|
| 237 | 237 | return new PublicationFieldDefinition(...$data); |
| 238 | 238 | }); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | protected function withoutNullValues(array $array): array |
| 242 | 242 | { |
| 243 | - return array_filter($array, fn (mixed $value): bool => ! is_null($value)); |
|
| 243 | + return array_filter($array, fn (mixed $value): bool => !is_null($value)); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |