@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | use Hyde\Framework\HydeKernel; |
4 | 4 | |
5 | -if (! function_exists('hyde')) { |
|
5 | +if (!function_exists('hyde')) { |
|
6 | 6 | /** |
7 | 7 | * Get the available HydeKernel instance. |
8 | 8 | * |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | } |
15 | 15 | } |
16 | 16 | |
17 | -if (! function_exists('unslash')) { |
|
17 | +if (!function_exists('unslash')) { |
|
18 | 18 | /** |
19 | 19 | * Remove trailing slashes from the start and end of a string. |
20 | 20 | * |
@@ -17,7 +17,7 @@ |
||
17 | 17 | /* |
18 | 18 | * Enable auto-discovery. |
19 | 19 | */ |
20 | - $this->app->singleton(PackageManifest::class, function () { |
|
20 | + $this->app->singleton(PackageManifest::class, function() { |
|
21 | 21 | return new PackageManifest( |
22 | 22 | new Filesystem, |
23 | 23 | $this->basePath(), |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | $path = static::path($filename); |
26 | 26 | |
27 | - if (! file_exists($path)) { |
|
27 | + if (!file_exists($path)) { |
|
28 | 28 | return $default; |
29 | 29 | } |
30 | 30 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $path = static::path(basename($filename, '.md').'.md'); |
38 | 38 | |
39 | - if (! file_exists($path)) { |
|
39 | + if (!file_exists($path)) { |
|
40 | 40 | return $default === null ? null : Markdown::render($default); |
41 | 41 | } |
42 | 42 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $path = static::path(basename($filename, '.blade.php').'.blade.php'); |
50 | 50 | |
51 | - if (! file_exists($path)) { |
|
51 | + if (!file_exists($path)) { |
|
52 | 52 | return $default === null ? null : Blade::render($default); |
53 | 53 | } |
54 | 54 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | protected static function needsDirectory(string $directory): void |
59 | 59 | { |
60 | - if (! file_exists($directory)) { |
|
60 | + if (!file_exists($directory)) { |
|
61 | 61 | mkdir($directory, recursive: true); |
62 | 62 | } |
63 | 63 | } |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | /** @return $this */ |
30 | 30 | public function generate(): static |
31 | 31 | { |
32 | - Hyde::routes()->each(function (Route $route) { |
|
32 | + Hyde::routes()->each(function(Route $route) { |
|
33 | 33 | $this->items->push(NavItem::fromRoute($route)); |
34 | 34 | }); |
35 | 35 | |
36 | - collect(config('hyde.navigation.custom', []))->each(function (NavItem $item) { |
|
36 | + collect(config('hyde.navigation.custom', []))->each(function(NavItem $item) { |
|
37 | 37 | $this->items->push($item); |
38 | 38 | }); |
39 | 39 | |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | |
60 | 60 | protected function filterHiddenItems(): Collection |
61 | 61 | { |
62 | - return $this->items->reject(function (NavItem $item) { |
|
62 | + return $this->items->reject(function(NavItem $item) { |
|
63 | 63 | return $item->hidden; |
64 | 64 | })->values(); |
65 | 65 | } |
66 | 66 | |
67 | 67 | protected function filterDuplicateItems(): Collection |
68 | 68 | { |
69 | - return $this->items->unique(function (NavItem $item) { |
|
69 | + return $this->items->unique(function(NavItem $item) { |
|
70 | 70 | return $item->resolveLink(); |
71 | 71 | }); |
72 | 72 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $route, |
52 | 52 | $route->getSourceModel()->navigationMenuTitle(), |
53 | 53 | $route->getSourceModel()->navigationMenuPriority(), |
54 | - ! $route->getSourceModel()->showInNavigation() |
|
54 | + !$route->getSourceModel()->showInNavigation() |
|
55 | 55 | ); |
56 | 56 | } |
57 | 57 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $current = Hyde::currentRoute()->getSourceModel(); |
97 | 97 | } |
98 | 98 | |
99 | - if (! isset($this->route)) { |
|
99 | + if (!isset($this->route)) { |
|
100 | 100 | return ($current->getRoute()->getRouteKey() === $this->href) |
101 | 101 | || ($current->getRoute()->getRouteKey().'.html' === $this->href); |
102 | 102 | } |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | /** @return $this */ |
16 | 16 | public function generate(): static |
17 | 17 | { |
18 | - Hyde::routes()->getRoutes(DocumentationPage::class)->each(function (Route $route) { |
|
19 | - if (! $route->getSourceModel()->get('hidden', false)) { |
|
20 | - $this->items->push(tap(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route)), function (NavItem $item) { |
|
18 | + Hyde::routes()->getRoutes(DocumentationPage::class)->each(function(Route $route) { |
|
19 | + if (!$route->getSourceModel()->get('hidden', false)) { |
|
20 | + $this->items->push(tap(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route)), function(NavItem $item) { |
|
21 | 21 | $item->title = $item->route->getSourceModel()->get('label'); |
22 | 22 | })); |
23 | 23 | } |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | |
34 | 34 | public function getGroups(): array |
35 | 35 | { |
36 | - return $this->items->map(function (NavItem $item) { |
|
36 | + return $this->items->map(function(NavItem $item) { |
|
37 | 37 | return $item->getGroup(); |
38 | 38 | })->unique()->toArray(); |
39 | 39 | } |
40 | 40 | |
41 | 41 | public function getItemsInGroup(?string $group): Collection |
42 | 42 | { |
43 | - return $this->items->filter(function ($item) use ($group) { |
|
43 | + return $this->items->filter(function($item) use ($group) { |
|
44 | 44 | return $item->getGroup() === $group || $item->getGroup() === Str::slug($group); |
45 | 45 | })->sortBy('priority')->values(); |
46 | 46 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | $path = Hyde::path('_media/'.$this->image->getSource()); |
69 | 69 | |
70 | - if (! file_exists($path)) { |
|
70 | + if (!file_exists($path)) { |
|
71 | 71 | $this->write(' > <comment>Warning:</comment> Could not find image file at '.$path.'!'); |
72 | 72 | $this->write(' <fg=gray> Using default content length of 0. '.'</>'); |
73 | 73 |
@@ -38,11 +38,11 @@ |
||
38 | 38 | |
39 | 39 | protected function makeCanonicalUrl(): ?string |
40 | 40 | { |
41 | - if (! empty($this->matter('canonicalUrl'))) { |
|
41 | + if (!empty($this->matter('canonicalUrl'))) { |
|
42 | 42 | return $this->matter('canonicalUrl'); |
43 | 43 | } |
44 | 44 | |
45 | - if (Hyde::hasSiteUrl() && ! empty($this->identifier)) { |
|
45 | + if (Hyde::hasSiteUrl() && !empty($this->identifier)) { |
|
46 | 46 | return $this->getRoute()->getQualifiedUrl(); |
47 | 47 | } |
48 | 48 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | { |
50 | 50 | $orderIndexArray = config('docs.sidebar_order', []); |
51 | 51 | |
52 | - if (! in_array($this->identifier, $orderIndexArray)) { |
|
52 | + if (!in_array($this->identifier, $orderIndexArray)) { |
|
53 | 53 | return 500; |
54 | 54 | } |
55 | 55 |