@@ -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 { |
@@ -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 | )); |