@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | public function generate(): self |
| 13 | 13 | { |
| 14 | - RoutingService::getInstance()->getRoutesForModel(DocumentationPage::class)->each(function (Route $route) { |
|
| 14 | + RoutingService::getInstance()->getRoutesForModel(DocumentationPage::class)->each(function(Route $route) { |
|
| 15 | 15 | $this->items->push(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route))); |
| 16 | 16 | }); |
| 17 | 17 | |
@@ -20,28 +20,28 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | public function hasGroups(): bool |
| 22 | 22 | { |
| 23 | - return $this->items->map(function (NavItem $item) { |
|
| 23 | + return $this->items->map(function(NavItem $item) { |
|
| 24 | 24 | return $item->getGroup() !== null; |
| 25 | 25 | })->contains(true); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function getGroups(): array |
| 29 | 29 | { |
| 30 | - return $this->items->map(function (NavItem $item) { |
|
| 30 | + return $this->items->map(function(NavItem $item) { |
|
| 31 | 31 | return $item->getGroup(); |
| 32 | 32 | })->unique()->toArray(); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function getItemsInGroup(?string $group): Collection |
| 36 | 36 | { |
| 37 | - return $this->items->filter(function ($item) use ($group) { |
|
| 37 | + return $this->items->filter(function($item) use ($group) { |
|
| 38 | 38 | return $item->getGroup() === $group || $item->getGroup() === Str::slug($group); |
| 39 | 39 | })->sortBy('priority')->values(); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | protected function filterHiddenItems(): Collection |
| 43 | 43 | { |
| 44 | - return $this->items->reject(function (NavItem $item) { |
|
| 44 | + return $this->items->reject(function(NavItem $item) { |
|
| 45 | 45 | return $item->route->getSourceModel()->matter('hidden', false) || ($item->route->getRouteKey() === 'docs/index'); |
| 46 | 46 | })->values(); |
| 47 | 47 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | $orderIndexArray = config('docs.sidebar_order', []); |
| 57 | 57 | |
| 58 | - if (! in_array($slug, $orderIndexArray)) { |
|
| 58 | + if (!in_array($slug, $orderIndexArray)) { |
|
| 59 | 59 | return 500; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public static function getSourceFileListForModel(string $model): array|false |
| 134 | 134 | { |
| 135 | - if (! class_exists($model) || ! is_subclass_of($model, AbstractPage::class)) { |
|
| 135 | + if (!class_exists($model) || !is_subclass_of($model, AbstractPage::class)) { |
|
| 136 | 136 | return false; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | $files = []; |
| 142 | 142 | foreach (glob(Hyde::path($model::qualifyBasename('{*,**/*}')), GLOB_BRACE) as $filepath) { |
| 143 | - if (! str_starts_with(basename($filepath), '_')) { |
|
| 143 | + if (!str_starts_with(basename($filepath), '_')) { |
|
| 144 | 144 | $files[] = self::formatSlugForModel($model, $filepath); |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public function hasSiteUrl(): bool |
| 219 | 219 | { |
| 220 | - return ! blank(config('site.url')); |
|
| 220 | + return !blank(config('site.url')); |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /** |
@@ -252,11 +252,11 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | public function copy(string $from, string $to, bool $force = false): bool|int |
| 254 | 254 | { |
| 255 | - if (! file_exists($from)) { |
|
| 255 | + if (!file_exists($from)) { |
|
| 256 | 256 | return 404; |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - if (file_exists($to) && ! $force) { |
|
| 259 | + if (file_exists($to) && !$force) { |
|
| 260 | 260 | return 409; |
| 261 | 261 | } |
| 262 | 262 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $actionTime = microtime(true); |
| 38 | 38 | |
| 39 | - if (! $this->runPreflightCheck()) { |
|
| 39 | + if (!$this->runPreflightCheck()) { |
|
| 40 | 40 | return 1; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -49,17 +49,17 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | protected function runPreflightCheck(): bool |
| 51 | 51 | { |
| 52 | - if (! SitemapService::canGenerateSitemap()) { |
|
| 52 | + if (!SitemapService::canGenerateSitemap()) { |
|
| 53 | 53 | $this->error('Cannot generate sitemap.xml, please check your configuration.'); |
| 54 | 54 | |
| 55 | - if (! Hyde::hasSiteUrl()) { |
|
| 55 | + if (!Hyde::hasSiteUrl()) { |
|
| 56 | 56 | $this->warn('Hint: You don\'t have a site URL configured. Check config/hyde.php'); |
| 57 | 57 | } |
| 58 | 58 | if (config('site.generate_sitemap', true) !== true) { |
| 59 | 59 | $this->warn('Hint: You have disabled sitemap generation in config/hyde.php'); |
| 60 | 60 | $this->line(' > You can enable sitemap generation by setting <info>`site.generate_sitemap`</> to <info>`true`</>'); |
| 61 | 61 | } |
| 62 | - if (! extension_loaded('simplexml') || config('testing.mock_disabled_extensions', false) === true) { |
|
| 62 | + if (!extension_loaded('simplexml') || config('testing.mock_disabled_extensions', false) === true) { |
|
| 63 | 63 | $this->warn('Hint: You don\'t have the <info>`simplexml`</> extension installed. Check your PHP installation.'); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | |
| 100 | 100 | protected static function xmlEscape(string $string): string |
| 101 | 101 | { |
| 102 | - return htmlspecialchars($string, ENT_XML1 | ENT_COMPAT, 'UTF-8'); |
|
| 102 | + return htmlspecialchars($string, ENT_XML1|ENT_COMPAT, 'UTF-8'); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | public static function getDescription(): string |