@@ -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, HydePage::class)) { |
|
| 39 | + if (!class_exists($model) || !is_subclass_of($model, HydePage::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 | |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | { |
| 59 | 59 | /** @var \Hyde\Pages\DocumentationPage $page */ |
| 60 | 60 | foreach (DocumentationPage::all() as $page) { |
| 61 | - if (! in_array($page->identifier, config('docs.exclude_from_search', []))) { |
|
| 61 | + if (!in_array($page->identifier, config('docs.exclude_from_search', []))) { |
|
| 62 | 62 | $this->searchIndex->push( |
| 63 | 63 | $this->generatePageEntry($page) |
| 64 | 64 | ); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | $this->app->singleton(AssetService::class, AssetService::class); |
| 34 | 34 | |
| 35 | - $this->app->singleton(MarkdownConverter::class, function () { |
|
| 35 | + $this->app->singleton(MarkdownConverter::class, function() { |
|
| 36 | 36 | return new MarkdownConverter(); |
| 37 | 37 | }); |
| 38 | 38 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | if (Features::hasDataCollections()) { |
| 27 | 27 | // Create the _data directory if it doesn't exist |
| 28 | - if (! is_dir(Hyde::path('_data'))) { |
|
| 28 | + if (!is_dir(Hyde::path('_data'))) { |
|
| 29 | 29 | mkdir(Hyde::path('_data')); |
| 30 | 30 | } |
| 31 | 31 | } |
@@ -55,6 +55,6 @@ |
||
| 55 | 55 | |
| 56 | 56 | public function hasWarnings(): bool |
| 57 | 57 | { |
| 58 | - return ! empty($this->warnings); |
|
| 58 | + return !empty($this->warnings); |
|
| 59 | 59 | } |
| 60 | 60 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | protected function setSource(string $source): void |
| 25 | 25 | { |
| 26 | - if (! str_starts_with($source, '_media/')) { |
|
| 26 | + if (!str_starts_with($source, '_media/')) { |
|
| 27 | 27 | // Throwing an exception here ensures we have a super predictable state. |
| 28 | 28 | throw new InvalidArgumentException('LocalFeaturedImage source must start with _media/'); |
| 29 | 29 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | protected function storageValidatedPath(): string |
| 53 | 53 | { |
| 54 | - if (! file_exists($this->storagePath())) { |
|
| 54 | + if (!file_exists($this->storagePath())) { |
|
| 55 | 55 | throw new FileNotFoundException("Image at $this->source does not exist"); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | /** @return $this */ |
| 19 | 19 | public function generate(): static |
| 20 | 20 | { |
| 21 | - Hyde::routes()->getRoutes(DocumentationPage::class)->each(function (Route $route) { |
|
| 22 | - $this->items->push(tap(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route)), function (NavItem $item) { |
|
| 21 | + Hyde::routes()->getRoutes(DocumentationPage::class)->each(function(Route $route) { |
|
| 22 | + $this->items->push(tap(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route)), function(NavItem $item) { |
|
| 23 | 23 | $item->label = $item->route->getPage()->get('navigation.label'); |
| 24 | 24 | })); |
| 25 | 25 | }); |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function getGroups(): array |
| 36 | 36 | { |
| 37 | - return $this->items->map(function (NavItem $item) { |
|
| 37 | + return $this->items->map(function(NavItem $item) { |
|
| 38 | 38 | return $item->getGroup(); |
| 39 | 39 | })->unique()->toArray(); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | public function getItemsInGroup(?string $group): Collection |
| 43 | 43 | { |
| 44 | - return $this->items->filter(function ($item) use ($group) { |
|
| 44 | + return $this->items->filter(function($item) use ($group) { |
|
| 45 | 45 | return $item->getGroup() === $group || $item->getGroup() === Str::slug($group); |
| 46 | 46 | })->sortBy('navigation.priority')->values(); |
| 47 | 47 | } |
@@ -53,6 +53,6 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | protected function filterDocumentationPage(NavItem $item): bool |
| 55 | 55 | { |
| 56 | - return ! parent::filterDocumentationPage($item); |
|
| 56 | + return !parent::filterDocumentationPage($item); |
|
| 57 | 57 | } |
| 58 | 58 | } |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | /** @return $this */ |
| 32 | 32 | public function generate(): static |
| 33 | 33 | { |
| 34 | - Hyde::routes()->each(function (Route $route) { |
|
| 34 | + Hyde::routes()->each(function(Route $route) { |
|
| 35 | 35 | $this->items->push(NavItem::fromRoute($route)); |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | - collect(config('hyde.navigation.custom', []))->each(function (NavItem $item) { |
|
| 38 | + collect(config('hyde.navigation.custom', []))->each(function(NavItem $item) { |
|
| 39 | 39 | $this->items->push($item); |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -61,14 +61,14 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | protected function filterHiddenItems(): Collection |
| 63 | 63 | { |
| 64 | - return $this->items->reject(function (NavItem $item) { |
|
| 64 | + return $this->items->reject(function(NavItem $item) { |
|
| 65 | 65 | return $item->hidden || $this->filterDocumentationPage($item); |
| 66 | 66 | })->values(); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | protected function filterDuplicateItems(): Collection |
| 70 | 70 | { |
| 71 | - return $this->items->unique(function (NavItem $item) { |
|
| 71 | + return $this->items->unique(function(NavItem $item) { |
|
| 72 | 72 | return $item->resolveLink(); |
| 73 | 73 | }); |
| 74 | 74 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $route, |
| 56 | 56 | $route->getPage()->navigationMenuLabel(), |
| 57 | 57 | $route->getPage()->navigationMenuPriority(), |
| 58 | - ! $route->getPage()->showInNavigation() |
|
| 58 | + !$route->getPage()->showInNavigation() |
|
| 59 | 59 | ); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $current = Hyde::currentRoute()->getPage(); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - if (! isset($this->route)) { |
|
| 103 | + if (!isset($this->route)) { |
|
| 104 | 104 | return ($current->getRoute()->getRouteKey() === $this->href) |
| 105 | 105 | || ($current->getRoute()->getRouteKey().'.html' === $this->href); |
| 106 | 106 | } |