@@ -179,8 +179,8 @@ |
||
| 179 | 179 | |
| 180 | 180 | protected function availableCanonicableFieldNames(): Collection |
| 181 | 181 | { |
| 182 | - return $this->fields->reject(function (PublicationFieldDefinition $field): bool { |
|
| 183 | - return ! in_array($field->type, PublicationFieldTypes::canonicable()); |
|
| 182 | + return $this->fields->reject(function(PublicationFieldDefinition $field): bool { |
|
| 183 | + return !in_array($field->type, PublicationFieldTypes::canonicable()); |
|
| 184 | 184 | })->pluck('name'); |
| 185 | 185 | } |
| 186 | 186 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $this->timeStart = microtime(true); |
| 67 | 67 | |
| 68 | - if (! $this->option('json')) { |
|
| 68 | + if (!$this->option('json')) { |
|
| 69 | 69 | $this->title('Validating publications!'); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $name = $this->argument('publicationType'); |
| 100 | 100 | |
| 101 | 101 | if (filled($name)) { |
| 102 | - if (! $publicationTypes->has($name)) { |
|
| 102 | + if (!$publicationTypes->has($name)) { |
|
| 103 | 103 | throw new InvalidArgumentException("Publication type [$name] does not exist"); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | protected function getMessageTypesInResult(array $results): array |
| 183 | 183 | { |
| 184 | - return array_map(function (string $result): string { |
|
| 184 | + return array_map(function(string $result): string { |
|
| 185 | 185 | return explode(':', $result)[0]; |
| 186 | 186 | }, array_values($results)); |
| 187 | 187 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | { |
| 46 | 46 | $timeStart = microtime(true); |
| 47 | 47 | |
| 48 | - if (! $this->option('json')) { |
|
| 48 | + if (!$this->option('json')) { |
|
| 49 | 49 | $this->title('Validating publication schemas!'); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | /** @return array<class-string<\Hyde\Framework\Features\BuildTasks\PreBuildTask>|class-string<\Hyde\Framework\Features\BuildTasks\PostBuildTask>> */ |
| 113 | 113 | protected function findTasksInAppDirectory(): array |
| 114 | 114 | { |
| 115 | - return Filesystem::smartGlob('app/Actions/*BuildTask.php')->map(function (string $file): string { |
|
| 115 | + return Filesystem::smartGlob('app/Actions/*BuildTask.php')->map(function(string $file): string { |
|
| 116 | 116 | return static::pathToClassName($file); |
| 117 | 117 | })->toArray(); |
| 118 | 118 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | protected static function validated(mixed $value, string $type, string $key): mixed |
| 59 | 59 | { |
| 60 | - if (! call_user_func("is_$type", $value)) { |
|
| 60 | + if (!call_user_func("is_$type", $value)) { |
|
| 61 | 61 | throw new TypeError(sprintf('%s(): Config value %s must be of type %s, %s given', __METHOD__, $key, $type, gettype($value))); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -35,6 +35,6 @@ |
||
| 35 | 35 | |
| 36 | 36 | public function showInNavigation(): bool |
| 37 | 37 | { |
| 38 | - return ! in_array($this->type->getDirectory(), Config::getArray('hyde.navigation.exclude', [])); |
|
| 38 | + return !in_array($this->type->getDirectory(), Config::getArray('hyde.navigation.exclude', [])); |
|
| 39 | 39 | } |
| 40 | 40 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $lineLength = max(array_map('strlen', array_map('strip_tags', $lines))); |
| 42 | 42 | |
| 43 | - $lines = array_map(function (string $line) use ($lineLength): string { |
|
| 43 | + $lines = array_map(function(string $line) use ($lineLength): string { |
|
| 44 | 44 | return sprintf(' │ <span class="text-white">%s</span>%s│', |
| 45 | 45 | $line, str_repeat(' ', ($lineLength - strlen(strip_tags($line))) + 1) |
| 46 | 46 | ); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | public function getFormatter(): Closure |
| 58 | 58 | { |
| 59 | - return function (string $type, string $line): void { |
|
| 59 | + return function(string $type, string $line): void { |
|
| 60 | 60 | $this->handleOutput($line); |
| 61 | 61 | }; |
| 62 | 62 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | protected function handleOutput(string $buffer): void |
| 71 | 71 | { |
| 72 | - str($buffer)->trim()->explode("\n")->each(function (string $line): void { |
|
| 72 | + str($buffer)->trim()->explode("\n")->each(function(string $line): void { |
|
| 73 | 73 | $this->renderLine($this->formatLineForOutput($line)); |
| 74 | 74 | }); |
| 75 | 75 | } |
@@ -62,12 +62,12 @@ |
||
| 62 | 62 | |
| 63 | 63 | protected function authorizePostRequest(): void |
| 64 | 64 | { |
| 65 | - if (! $this->isRequestMadeFromLocalhost()) { |
|
| 65 | + if (!$this->isRequestMadeFromLocalhost()) { |
|
| 66 | 66 | throw new HttpException(403, "Refusing to serve request from address {$_SERVER['REMOTE_ADDR']} (must be on localhost)"); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if ($this->withSession) { |
| 70 | - if (! $this->validateCSRFToken($this->request->get('_token'))) { |
|
| 70 | + if (!$this->validateCSRFToken($this->request->get('_token'))) { |
|
| 71 | 71 | throw new HttpException(403, 'Invalid CSRF token'); |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -46,11 +46,11 @@ |
||
| 46 | 46 | |
| 47 | 47 | $page = Hyde::pages()->getPage($pagePath); |
| 48 | 48 | |
| 49 | - if (! $page instanceof BaseMarkdownPage) { |
|
| 49 | + if (!$page instanceof BaseMarkdownPage) { |
|
| 50 | 50 | $this->abort(400, 'Page is not a markdown page'); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if (! $force && hash('sha256', $page->markdown()->body()) !== $currentContentHash) { |
|
| 53 | + if (!$force && hash('sha256', $page->markdown()->body()) !== $currentContentHash) { |
|
| 54 | 54 | $this->abort(409, 'Content has changed in another window'); |
| 55 | 55 | } |
| 56 | 56 | |