@@ -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 { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | public function getRoutes(?string $pageClass = null): self |
| 40 | 40 | { |
| 41 | - return ! $pageClass ? $this : $this->filter(function (Route $route) use ($pageClass): bool { |
|
| 41 | + return !$pageClass ? $this : $this->filter(function(Route $route) use ($pageClass) : bool { |
|
| 42 | 42 | return $route->getPage() instanceof $pageClass; |
| 43 | 43 | }); |
| 44 | 44 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | protected function runDiscovery(): self |
| 67 | 67 | { |
| 68 | - $this->kernel->pages()->each(function (HydePage $page): void { |
|
| 68 | + $this->kernel->pages()->each(function(HydePage $page): void { |
|
| 69 | 69 | $this->discover($page); |
| 70 | 70 | }); |
| 71 | 71 | |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | use Rector\Set\ValueObject\SetList; |
| 8 | 8 | use RectorLaravel\Set\LaravelSetList; |
| 9 | 9 | |
| 10 | -return static function (RectorConfig $rectorConfig): void { |
|
| 10 | +return static function(RectorConfig $rectorConfig): void { |
|
| 11 | 11 | $rectorConfig->paths([__DIR__.'/packages/framework/src']); |
| 12 | 12 | $rectorConfig->sets([ |
| 13 | 13 | LaravelSetList::LARAVEL_90, |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | public function getPages(?string $pageClass = null): self |
| 38 | 38 | { |
| 39 | - return ! $pageClass ? $this : $this->filter(function (HydePage $page) use ($pageClass): bool { |
|
| 39 | + return !$pageClass ? $this : $this->filter(function(HydePage $page) use ($pageClass) : bool { |
|
| 40 | 40 | return $page instanceof $pageClass; |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | protected function discoverPagesFor(string $pageClass): void |
| 95 | 95 | { |
| 96 | - $this->parsePagesFor($pageClass)->each(function (HydePage $page): void { |
|
| 96 | + $this->parsePagesFor($pageClass)->each(function(HydePage $page): void { |
|
| 97 | 97 | $this->addPage($page); |
| 98 | 98 | }); |
| 99 | 99 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function boot(): void |
| 22 | 22 | { |
| 23 | - if (! $this->readyToBoot || $this->booting) { |
|
| 23 | + if (!$this->readyToBoot || $this->booting) { |
|
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | /** @var \Hyde\Pages\Concerns\HydePage $model */ |
| 25 | 25 | $filepath = $model::sourcePath($identifier); |
| 26 | 26 | |
| 27 | - if (! file_exists(Hyde::path($filepath))) { |
|
| 27 | + if (!file_exists(Hyde::path($filepath))) { |
|
| 28 | 28 | throw new FileNotFoundException($filepath); |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | throw new BadMethodCallException('Cannot register a page class after the Kernel has been booted.'); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if (! is_subclass_of($pageClass, HydePage::class)) { |
|
| 76 | + if (!is_subclass_of($pageClass, HydePage::class)) { |
|
| 77 | 77 | throw new InvalidArgumentException('The specified class must be a subclass of HydePage.'); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | throw new InvalidArgumentException('The specified class must not be a subclass of DynamicPage.'); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if (! in_array($pageClass, $this->pageClasses, true)) { |
|
| 84 | + if (!in_array($pageClass, $this->pageClasses, true)) { |
|
| 85 | 85 | $this->pageClasses[] = $pageClass; |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | /** @param class-string<\Hyde\Foundation\Concerns\HydeExtension> $extension */ |
| 96 | 96 | public function registerExtension(string $extension): void |
| 97 | 97 | { |
| 98 | - if (! in_array($extension, $this->extensions, true)) { |
|
| 98 | + if (!in_array($extension, $this->extensions, true)) { |
|
| 99 | 99 | $this->extensions[] = $extension; |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | return $this->__call('compile', []); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - if (! $this->contents && $this->view) { |
|
| 92 | + if (!$this->contents && $this->view) { |
|
| 93 | 93 | if (str_ends_with($this->view, '.blade.php')) { |
| 94 | 94 | return AnonymousViewCompiler::call($this->view, $this->matter->toArray()); |
| 95 | 95 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function __call(string $method, array $parameters): mixed |
| 115 | 115 | { |
| 116 | - if (! isset($this->macros[$method])) { |
|
| 116 | + if (!isset($this->macros[$method])) { |
|
| 117 | 117 | throw new BadMethodCallException(sprintf( |
| 118 | 118 | 'Method %s::%s does not exist.', static::class, $method |
| 119 | 119 | )); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | public function previousPageNumber(): false|int |
| 132 | 132 | { |
| 133 | - if (! $this->canNavigateBack()) { |
|
| 133 | + if (!$this->canNavigateBack()) { |
|
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | 136 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | public function nextPageNumber(): false|int |
| 141 | 141 | { |
| 142 | - if (! $this->canNavigateForward()) { |
|
| 142 | + if (!$this->canNavigateForward()) { |
|
| 143 | 143 | return false; |
| 144 | 144 | } |
| 145 | 145 | |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | public function previous(): false|string|Route |
| 150 | 150 | { |
| 151 | - if (! $this->canNavigateBack()) { |
|
| 151 | + if (!$this->canNavigateBack()) { |
|
| 152 | 152 | return false; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - if (! isset($this->routeBasename)) { |
|
| 155 | + if (!isset($this->routeBasename)) { |
|
| 156 | 156 | return $this->formatLink(-1); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -161,11 +161,11 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | public function next(): false|string|Route |
| 163 | 163 | { |
| 164 | - if (! $this->canNavigateForward()) { |
|
| 164 | + if (!$this->canNavigateForward()) { |
|
| 165 | 165 | return false; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - if (! isset($this->routeBasename)) { |
|
| 168 | + if (!isset($this->routeBasename)) { |
|
| 169 | 169 | return $this->formatLink(+1); |
| 170 | 170 | } |
| 171 | 171 | |