@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | /** @return $this */ |
31 | 31 | public function generate(): static |
32 | 32 | { |
33 | - Router::each(function (Route $route): void { |
|
33 | + Router::each(function(Route $route): void { |
|
34 | 34 | $this->items->put($route->getRouteKey(), NavItem::fromRoute($route)); |
35 | 35 | }); |
36 | 36 | |
37 | - collect(config('hyde.navigation.custom', []))->each(function (NavItem $item): void { |
|
37 | + collect(config('hyde.navigation.custom', []))->each(function(NavItem $item): void { |
|
38 | 38 | $this->items->push($item); |
39 | 39 | }); |
40 | 40 | |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | |
61 | 61 | protected function filterHiddenItems(): Collection |
62 | 62 | { |
63 | - return $this->items->reject(function (NavItem $item): bool { |
|
63 | + return $this->items->reject(function(NavItem $item): bool { |
|
64 | 64 | return $this->shouldItemBeHidden($item); |
65 | 65 | })->values(); |
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function filterDuplicateItems(): Collection |
69 | 69 | { |
70 | - return $this->items->unique(function (NavItem $item): string { |
|
70 | + return $this->items->unique(function(NavItem $item): string { |
|
71 | 71 | return $item->label; |
72 | 72 | }); |
73 | 73 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public const NAVIGATION_SCHEMA = [ |
14 | 14 | 'label' => 'string', |
15 | 15 | 'group' => 'string', // Category is also supported |
16 | - 'hidden' => 'bool', // Visible is also supported (but obviously invert the value) |
|
17 | - 'priority' => 'int', // Order is also supported |
|
16 | + 'hidden' => 'bool', // Visible is also supported (but obviously invert the value) |
|
17 | + 'priority' => 'int', // Order is also supported |
|
18 | 18 | ]; |
19 | 19 | } |
@@ -191,7 +191,7 @@ |
||
191 | 191 | |
192 | 192 | protected function invert(?bool $value): ?bool |
193 | 193 | { |
194 | - return $value === null ? null : ! $value; |
|
194 | + return $value === null ? null : !$value; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | protected function offset(?int $value, int $offset): ?int |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | public function getContentLength(): int |
28 | 28 | { |
29 | - if (! is_file($this->path)) { |
|
29 | + if (!is_file($this->path)) { |
|
30 | 30 | throw new FileNotFoundException(message: "Could not get the content length of file '$this->path'"); |
31 | 31 | } |
32 | 32 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function getSourceFiles(?string $pageClass = null): self |
36 | 36 | { |
37 | - return ! $pageClass ? $this->getAllSourceFiles() : $this->getSourceFilesFor($pageClass); |
|
37 | + return !$pageClass ? $this->getAllSourceFiles() : $this->getSourceFilesFor($pageClass); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | // Scan the source directory, and directories therein, for files that match the model's file extension. |
94 | 94 | foreach (glob($this->kernel->path($pageClass::sourcePath('{*,**/*}')), GLOB_BRACE) as $filepath) { |
95 | - if (! str_starts_with(basename((string) $filepath), '_')) { |
|
95 | + if (!str_starts_with(basename((string) $filepath), '_')) { |
|
96 | 96 | $this->put($this->kernel->pathToRelative($filepath), SourceFile::make($filepath, $pageClass)); |
97 | 97 | } |
98 | 98 | } |
@@ -70,11 +70,11 @@ |
||
70 | 70 | */ |
71 | 71 | public static function getSourceFileListForModel(string $model): array |
72 | 72 | { |
73 | - if (! class_exists($model) || ! is_subclass_of($model, HydePage::class)) { |
|
73 | + if (!class_exists($model) || !is_subclass_of($model, HydePage::class)) { |
|
74 | 74 | throw new UnsupportedPageTypeException($model); |
75 | 75 | } |
76 | 76 | |
77 | - return FileCollection::getSourceFiles($model)->flatten()->map(function (SourceFile $file) use ($model): string { |
|
77 | + return FileCollection::getSourceFiles($model)->flatten()->map(function(SourceFile $file) use ($model): string { |
|
78 | 78 | return static::pathToIdentifier($model, $file->withoutDirectoryPrefix()); |
79 | 79 | })->toArray(); |
80 | 80 | } |
@@ -66,7 +66,7 @@ |
||
66 | 66 | '.gitkeep', |
67 | 67 | ]; |
68 | 68 | |
69 | - if (! in_array(basename($filepath), $protected)) { |
|
69 | + if (!in_array(basename($filepath), $protected)) { |
|
70 | 70 | unlink($filepath); |
71 | 71 | } |
72 | 72 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | if (sizeof($this->fileMemory) > 0) { |
52 | 52 | foreach ($this->fileMemory as $file) { |
53 | 53 | if (Filesystem::isDirectory($file)) { |
54 | - if (! in_array($file, ['_site', '_media', '_pages', '_posts', '_docs', 'app', 'config', 'storage', 'vendor', 'node_modules'])) { |
|
54 | + if (!in_array($file, ['_site', '_media', '_pages', '_posts', '_docs', 'app', 'config', 'storage', 'vendor', 'node_modules'])) { |
|
55 | 55 | Filesystem::deleteDirectory($file); |
56 | 56 | } |
57 | 57 | } else { |
@@ -52,7 +52,7 @@ |
||
52 | 52 | |
53 | 53 | public function processInput(): static |
54 | 54 | { |
55 | - $this->output = implode("\n", array_map(function ($line): string { |
|
55 | + $this->output = implode("\n", array_map(function($line): string { |
|
56 | 56 | return $this->expandShortcode($line); |
57 | 57 | }, explode("\n", $this->input))); |
58 | 58 |