@@ -91,7 +91,7 @@ |
||
| 91 | 91 | */ |
| 92 | 92 | public function hasFileConflict(): bool |
| 93 | 93 | { |
| 94 | - return $this->fileExists() && ! $this->force; |
|
| 94 | + return $this->fileExists() && !$this->force; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | protected function save(string $contents): void |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | */ |
| 83 | 83 | protected function normalizeData(Collection $data): array |
| 84 | 84 | { |
| 85 | - return $data->mapWithKeys(function (PublicationFieldValue $field, string $key): array { |
|
| 85 | + return $data->mapWithKeys(function(PublicationFieldValue $field, string $key): array { |
|
| 86 | 86 | return [$key => $field->getValue()]; |
| 87 | 87 | })->toArray(); |
| 88 | 88 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | /** @return array<int, string> */ |
| 67 | 67 | public function errors(): array |
| 68 | 68 | { |
| 69 | - return collect($this->validator->errors())->map(function (array $message): string { |
|
| 69 | + return collect($this->validator->errors())->map(function(array $message): string { |
|
| 70 | 70 | return implode(', ', $message); |
| 71 | 71 | })->toArray(); |
| 72 | 72 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $fields = $this->publicationType->getFields()->pluck('name')->toArray(); |
| 79 | 79 | foreach ($this->matter as $key => $value) { |
| 80 | - if (! in_array($key, $fields)) { |
|
| 80 | + if (!in_array($key, $fields)) { |
|
| 81 | 81 | $warnings[$key] = sprintf('The %s field is not defined in the publication type.', lcfirst(Str::title($key))); |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | protected static function parseIntegerValue(string $value): int |
| 43 | 43 | { |
| 44 | - if (! is_numeric($value)) { |
|
| 44 | + if (!is_numeric($value)) { |
|
| 45 | 45 | throw self::parseError('integer', $value); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | protected static function parseFloatValue(string $value): float |
| 52 | 52 | { |
| 53 | - if (! is_numeric($value)) { |
|
| 53 | + if (!is_numeric($value)) { |
|
| 54 | 54 | throw self::parseError('float', $value); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | protected static function parseUrlValue(string $value): string |
| 82 | 82 | { |
| 83 | - if (! filter_var($value, FILTER_VALIDATE_URL)) { |
|
| 83 | + if (!filter_var($value, FILTER_VALIDATE_URL)) { |
|
| 84 | 84 | throw self::parseError('url', $value); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | $sortAscending ??= $publicationType->sortAscending; |
| 45 | 45 | $sortField ??= $publicationType->sortField; |
| 46 | 46 | |
| 47 | - return $publications->sortBy(function (PublicationPage $page) use ($sortField): mixed { |
|
| 47 | + return $publications->sortBy(function(PublicationPage $page) use ($sortField): mixed { |
|
| 48 | 48 | return $page->matter($sortField); |
| 49 | - }, descending: ! $sortAscending)->values()->toBase(); |
|
| 49 | + }, descending: !$sortAscending)->values()->toBase(); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public static function getMediaForType(PublicationType $publicationType): Collection |
| 56 | 56 | { |
| 57 | - return collect(MediaFile::all())->filter(function (MediaFile $file) use ($publicationType): bool { |
|
| 57 | + return collect(MediaFile::all())->filter(function(MediaFile $file) use ($publicationType): bool { |
|
| 58 | 58 | return Str::startsWith($file->getPath(), Hyde::getMediaDirectory().'/'.$publicationType->getDirectory()); |
| 59 | 59 | })->keys()->toBase(); |
| 60 | 60 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | if ($number >= 10000) { |
| 45 | 45 | $this->warn('Warning: Generating a large number of publications may take a while. <fg=gray>Expected time: '.($number / 1000).' seconds.</>'); |
| 46 | - if (! $this->confirm('Are you sure you want to continue?')) { |
|
| 46 | + if (!$this->confirm('Are you sure you want to continue?')) { |
|
| 47 | 47 | return parent::USER_EXIT; |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public const TERMINATION_SEQUENCE = '<<<'; |
| 26 | 26 | public const END_OF_TRANSMISSION = "\x04"; |
| 27 | 27 | |
| 28 | - private static ?array $mockedStreamBuffer = null; |
|
| 28 | + private static ? array $mockedStreamBuffer = null; |
|
| 29 | 29 | |
| 30 | 30 | public static function call(): array |
| 31 | 31 | { |
@@ -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 | } |