@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public static function handle(string $directory, array|string|false $matchExtensions = false, bool $recursive = false): Collection |
23 | 23 | { |
24 | - if (! Filesystem::isDirectory($directory)) { |
|
24 | + if (!Filesystem::isDirectory($directory)) { |
|
25 | 25 | return collect(); |
26 | 26 | } |
27 | 27 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $finder->name(static::buildFileExtensionPattern((array) $matchExtensions)); |
36 | 36 | } |
37 | 37 | |
38 | - return collect($finder)->map(function (SplFileInfo $file): string { |
|
38 | + return collect($finder)->map(function(SplFileInfo $file): string { |
|
39 | 39 | return Hyde::pathToRelative($file->getPathname()); |
40 | 40 | })->sort()->values(); |
41 | 41 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | /** @param array<string> $extensions */ |
52 | 52 | private static function expandCommaSeparatedValues(array $extensions): array |
53 | 53 | { |
54 | - return array_merge(...array_map(function (string $item): array { |
|
54 | + return array_merge(...array_map(function(string $item): array { |
|
55 | 55 | return array_map(fn (string $item): string => trim($item), explode(',', $item)); |
56 | 56 | }, $extensions)); |
57 | 57 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | /** @param array<string> $extensions */ |
60 | 60 | private static function normalizeExtensionForRegexPattern(array $extensions): string |
61 | 61 | { |
62 | - return implode('|', array_map(function (string $extension): string { |
|
62 | + return implode('|', array_map(function(string $extension): string { |
|
63 | 63 | return preg_quote(ltrim($extension, '.'), '/'); |
64 | 64 | }, $extensions)); |
65 | 65 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | // Scan the source directory, and directories therein, for files that match the model's file extension. |
62 | 62 | foreach (Filesystem::findFiles($pageClass::sourceDirectory(), $pageClass::fileExtension(), true) as $path) { |
63 | - if (! str_starts_with(basename((string) $path), '_')) { |
|
63 | + if (!str_starts_with(basename((string) $path), '_')) { |
|
64 | 64 | $this->addFile(SourceFile::make($path, $pageClass)); |
65 | 65 | } |
66 | 66 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | /** @param class-string<\Hyde\Pages\Concerns\HydePage>|null $pageClass */ |
75 | 75 | public function getFiles(?string $pageClass = null): FileCollection |
76 | 76 | { |
77 | - return $pageClass ? $this->filter(function (SourceFile $file) use ($pageClass): bool { |
|
77 | + return $pageClass ? $this->filter(function(SourceFile $file) use ($pageClass) : bool { |
|
78 | 78 | return $file->pageClass === $pageClass; |
79 | 79 | }) : $this; |
80 | 80 | } |