@@ -105,7 +105,7 @@ |
||
105 | 105 | |
106 | 106 | protected function findTasksInAppDirectory(): array |
107 | 107 | { |
108 | - return Filesystem::smartGlob('app/Actions/*BuildTask.php')->map(function (string $file): string { |
|
108 | + return Filesystem::smartGlob('app/Actions/*BuildTask.php')->map(function(string $file): string { |
|
109 | 109 | return static::pathToClassName($file); |
110 | 110 | })->toArray(); |
111 | 111 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | $this->startClock(); |
41 | 41 | |
42 | - if ($output && ! $this->output) { |
|
42 | + if ($output && !$this->output) { |
|
43 | 43 | $this->setOutput($output); |
44 | 44 | } |
45 | 45 |
@@ -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; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | static::needsDirectory(static::$sourceDirectory); |
50 | 50 | |
51 | - return new static(DataCollection::findFiles($name, 'md')->mapWithKeys(function (string $file): array { |
|
51 | + return new static(DataCollection::findFiles($name, 'md')->mapWithKeys(function(string $file): array { |
|
52 | 52 | return [static::makeIdentifier($file) => (new MarkdownFileParser($file))->get()]; |
53 | 53 | })); |
54 | 54 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | static::needsDirectory(static::$sourceDirectory); |
66 | 66 | |
67 | - return new static(DataCollection::findFiles($name, ['yaml', 'yml'])->mapWithKeys(function (string $file): array { |
|
67 | + return new static(DataCollection::findFiles($name, ['yaml', 'yml'])->mapWithKeys(function(string $file): array { |
|
68 | 68 | return [static::makeIdentifier($file) => (new MarkdownFileParser($file))->get()->matter()]; |
69 | 69 | })); |
70 | 70 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | static::needsDirectory(static::$sourceDirectory); |
82 | 82 | |
83 | - return new static(DataCollection::findFiles($name, 'json')->mapWithKeys(function (string $file) use ($asArray): array { |
|
83 | + return new static(DataCollection::findFiles($name, 'json')->mapWithKeys(function(string $file) use ($asArray): array { |
|
84 | 84 | return [static::makeIdentifier($file) => json_decode(Filesystem::get($file), $asArray)]; |
85 | 85 | })); |
86 | 86 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | public function generate(): static |
31 | 31 | { |
32 | - \Hyde\Facades\Route::all()->each(function (Route $route): void { |
|
32 | + \Hyde\Facades\Route::all()->each(function(Route $route): void { |
|
33 | 33 | $this->addRoute($route); |
34 | 34 | }); |
35 | 35 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | public function compileStaticPages(): void |
43 | 43 | { |
44 | - collect($this->getPageTypes())->each(function (string $pageClass): void { |
|
44 | + collect($this->getPageTypes())->each(function(string $pageClass): void { |
|
45 | 45 | $this->compilePagesForClass($pageClass); |
46 | 46 | }); |
47 | 47 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $this->needsDirectory(Hyde::siteMediaPath()); |
52 | 52 | |
53 | 53 | $this->comment('Transferring Media Assets...'); |
54 | - $this->withProgressBar(MediaFile::files(), function (string $identifier): void { |
|
54 | + $this->withProgressBar(MediaFile::files(), function(string $identifier): void { |
|
55 | 55 | $sitePath = Hyde::siteMediaPath($identifier); |
56 | 56 | $this->needsParentDirectory($sitePath); |
57 | 57 | copy(Hyde::mediaPath($identifier), $sitePath); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $collection = Routes::getRoutes($pageClass); |
71 | 71 | |
72 | - $this->withProgressBar($collection, function (Route $route): void { |
|
72 | + $this->withProgressBar($collection, function(Route $route): void { |
|
73 | 73 | (new StaticPageBuilder($route->getPage()))->__invoke(); |
74 | 74 | }); |
75 | 75 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | /** @return array<class-string<\Hyde\Pages\Concerns\HydePage>> */ |
85 | 85 | protected function getPageTypes(): array |
86 | 86 | { |
87 | - return Hyde::pages()->map(function (HydePage $page): string { |
|
87 | + return Hyde::pages()->map(function(HydePage $page): string { |
|
88 | 88 | return $page::class; |
89 | 89 | })->unique()->values()->toArray(); |
90 | 90 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | public function getContentLength(): int |
57 | 57 | { |
58 | - if (! is_file($this->getAbsolutePath())) { |
|
58 | + if (!is_file($this->getAbsolutePath())) { |
|
59 | 59 | throw new FileNotFoundException(message: "Could not get the content length of file [$this->path]"); |
60 | 60 | } |
61 | 61 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | protected static function discoverMediaAssetFiles(): array |
98 | 98 | { |
99 | - return collect(static::getMediaAssetFiles())->mapWithKeys(function (string $filepath): array { |
|
99 | + return collect(static::getMediaAssetFiles())->mapWithKeys(function(string $filepath): array { |
|
100 | 100 | $file = static::make($filepath); |
101 | 101 | |
102 | 102 | return [$file->getIdentifier() => $file]; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public static function files(): array |
120 | 120 | { |
121 | - return Files::getFiles(static::class)->map(function (SourceFile $file): string { |
|
121 | + return Files::getFiles(static::class)->map(function(SourceFile $file): string { |
|
122 | 122 | return DiscoveryService::pathToIdentifier(static::class, $file->getPath()); |
123 | 123 | })->values()->toArray(); |
124 | 124 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | public function showInNavigation(): bool |
325 | 325 | { |
326 | - return ! $this->navigation['hidden']; |
|
326 | + return !$this->navigation['hidden']; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | public function navigationMenuPriority(): int |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | protected function runDiscovery(): void |
35 | 35 | { |
36 | - $this->kernel->files()->each(function (SourceFile $file): void { |
|
36 | + $this->kernel->files()->each(function(SourceFile $file): void { |
|
37 | 37 | $this->addPage($file->model::parse( |
38 | 38 | DiscoveryService::pathToIdentifier($file->model, $file->getPath()) |
39 | 39 | )); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function getPages(?string $pageClass = null): PageCollection |
61 | 61 | { |
62 | - return $pageClass ? $this->filter(function (HydePage $page) use ($pageClass): bool { |
|
62 | + return $pageClass ? $this->filter(function(HydePage $page) use ($pageClass) : bool { |
|
63 | 63 | return $page instanceof $pageClass; |
64 | 64 | }) : $this; |
65 | 65 | } |