@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | public function files(): FileCollection |
| 111 | 111 | { |
| 112 | - if (! $this->booted) { |
|
| 112 | + if (!$this->booted) { |
|
| 113 | 113 | $this->boot(); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | public function pages(): PageCollection |
| 120 | 120 | { |
| 121 | - if (! $this->booted) { |
|
| 121 | + if (!$this->booted) { |
|
| 122 | 122 | $this->boot(); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | public function routes(): RouteCollection |
| 129 | 129 | { |
| 130 | - if (! $this->booted) { |
|
| 130 | + if (!$this->booted) { |
|
| 131 | 131 | $this->boot(); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -18,26 +18,26 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | public function getSourceFiles(?string $pageClass = null): self |
| 20 | 20 | { |
| 21 | - return ! $pageClass ? $this->getAllSourceFiles() : $this->getSourceFilesFor($pageClass); |
|
| 21 | + return !$pageClass ? $this->getAllSourceFiles() : $this->getSourceFilesFor($pageClass); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | public function getAllSourceFiles(): self |
| 25 | 25 | { |
| 26 | - return $this->filter(function (File $file) { |
|
| 26 | + return $this->filter(function(File $file) { |
|
| 27 | 27 | return $file->belongsTo !== null; |
| 28 | 28 | }); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function getSourceFilesFor(string $pageClass): self |
| 32 | 32 | { |
| 33 | - return $this->filter(function (File $file) use ($pageClass): bool { |
|
| 33 | + return $this->filter(function(File $file) use ($pageClass): bool { |
|
| 34 | 34 | return $file->belongsTo() === $pageClass; |
| 35 | 35 | }); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function getMediaFiles(): self |
| 39 | 39 | { |
| 40 | - return $this->filter(function (File $file): bool { |
|
| 40 | + return $this->filter(function(File $file): bool { |
|
| 41 | 41 | return str_starts_with($file, '_media'); |
| 42 | 42 | }); |
| 43 | 43 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | // Scan the source directory, and directories therein, for files that match the model's file extension. |
| 72 | 72 | foreach (glob($this->kernel->path($pageClass::qualifyBasename('{*,**/*}')), GLOB_BRACE) as $filepath) { |
| 73 | - if (! str_starts_with(basename($filepath), '_')) { |
|
| 73 | + if (!str_starts_with(basename($filepath), '_')) { |
|
| 74 | 74 | $this->put($this->kernel->pathToRelative($filepath), File::make($filepath)->belongsTo($pageClass)); |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | public function getRoutes(?string $pageClass = null): self |
| 35 | 35 | { |
| 36 | - return ! $pageClass ? $this : $this->filter(function (RouteContract $route) use ($pageClass) { |
|
| 36 | + return !$pageClass ? $this : $this->filter(function(RouteContract $route) use ($pageClass) { |
|
| 37 | 37 | return $route->getSourceModel() instanceof $pageClass; |
| 38 | 38 | }); |
| 39 | 39 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | protected function runDiscovery(): self |
| 61 | 61 | { |
| 62 | - $this->kernel->pages()->each(function (PageContract $page) { |
|
| 62 | + $this->kernel->pages()->each(function(PageContract $page) { |
|
| 63 | 63 | $this->discover($page); |
| 64 | 64 | }); |
| 65 | 65 | |
@@ -36,12 +36,12 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public static function getSourceFileListForModel(string $model): array |
| 38 | 38 | { |
| 39 | - if (! class_exists($model) || ! is_subclass_of($model, AbstractPage::class)) { |
|
| 39 | + if (!class_exists($model) || !is_subclass_of($model, AbstractPage::class)) { |
|
| 40 | 40 | throw new UnsupportedPageTypeException($model); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $files = []; |
| 44 | - Hyde::files()->getSourceFiles($model)->each(function (File $file) use (&$files, $model) { |
|
| 44 | + Hyde::files()->getSourceFiles($model)->each(function(File $file) use (&$files, $model) { |
|
| 45 | 45 | $files[] = self::formatSlugForModel($model, $file->withoutDirectoryPrefix()); |
| 46 | 46 | }); |
| 47 | 47 | |