@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | protected function isItSafeToCleanOutputDirectory(): bool |
34 | 34 | { |
35 | - if (! $this->isOutputDirectoryWhitelisted() && ! $this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
35 | + if (!$this->isOutputDirectoryWhitelisted() && !$this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
36 | 36 | $this->info('Output directory will not be emptied.'); |
37 | 37 | |
38 | 38 | return false; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | protected function runDiscovery(): void |
34 | 34 | { |
35 | - $this->kernel->pages()->each(function (HydePage $page): void { |
|
35 | + $this->kernel->pages()->each(function(HydePage $page): void { |
|
36 | 36 | $this->addRoute(new Route($page)); |
37 | 37 | }); |
38 | 38 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function getRoutes(?string $pageClass = null): RouteCollection |
57 | 57 | { |
58 | - return $pageClass ? $this->filter(function (Route $route) use ($pageClass): bool { |
|
58 | + return $pageClass ? $this->filter(function(Route $route) use ($pageClass) : bool { |
|
59 | 59 | return $route->getPage() instanceof $pageClass; |
60 | 60 | }) : $this; |
61 | 61 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | protected function generate(): void |
21 | 21 | { |
22 | - Routes::getRoutes(DocumentationPage::class)->each(function (Route $route): void { |
|
22 | + Routes::getRoutes(DocumentationPage::class)->each(function(Route $route): void { |
|
23 | 23 | if ($this->canAddRoute($route)) { |
24 | 24 | $this->items->put($route->getRouteKey(), NavItem::fromRoute($route)); |
25 | 25 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** @return array<string> */ |
35 | 35 | public function getGroups(): array |
36 | 36 | { |
37 | - return $this->items->map(function (NavItem $item): string { |
|
37 | + return $this->items->map(function(NavItem $item): string { |
|
38 | 38 | return $item->getGroup(); |
39 | 39 | })->unique()->toArray(); |
40 | 40 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | /** @return Collection<\Hyde\Framework\Features\Navigation\NavItem> */ |
43 | 43 | public function getItemsInGroup(?string $group): Collection |
44 | 44 | { |
45 | - return $this->items->filter(function (NavItem $item) use ($group): bool { |
|
45 | + return $this->items->filter(function(NavItem $item) use ($group) : bool { |
|
46 | 46 | return ($item->getGroup() === $group) || ($item->getGroup() === Str::slug($group)); |
47 | 47 | })->sortBy('navigation.priority')->values(); |
48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | protected function canAddRoute(Route $route): bool |
57 | 57 | { |
58 | - return parent::canAddRoute($route) && ! $route->is(DocumentationPage::homeRouteName()); |
|
58 | + return parent::canAddRoute($route) && !$route->is(DocumentationPage::homeRouteName()); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | private function isPageIndexPage(): bool |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | |
37 | 37 | protected function generate(): void |
38 | 38 | { |
39 | - Routes::each(function (Route $route): void { |
|
39 | + Routes::each(function(Route $route): void { |
|
40 | 40 | if ($this->canAddRoute($route)) { |
41 | 41 | $this->items->put($route->getRouteKey(), NavItem::fromRoute($route)); |
42 | 42 | } |
43 | 43 | }); |
44 | 44 | |
45 | - collect(Config::getArray('hyde.navigation.custom', []))->each(function (NavItem $item): void { |
|
45 | + collect(Config::getArray('hyde.navigation.custom', []))->each(function(NavItem $item): void { |
|
46 | 46 | // Since these were added explicitly by the user, we can assume they should always be shown |
47 | 47 | $this->items->push($item); |
48 | 48 | }); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | protected function removeDuplicateItems(): void |
57 | 57 | { |
58 | - $this->items = $this->items->unique(function (NavItem $item): string { |
|
58 | + $this->items = $this->items->unique(function(NavItem $item): string { |
|
59 | 59 | // Filter using a combination of the group and label to allow duplicate labels in different groups |
60 | 60 | return $item->getGroup().$item->label; |
61 | 61 | }); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | public function generate(): static |
32 | 32 | { |
33 | - Routes::all()->each(function (Route $route): void { |
|
33 | + Routes::all()->each(function(Route $route): void { |
|
34 | 34 | $this->addRoute($route); |
35 | 35 | }); |
36 | 36 |
@@ -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 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | $this->displaySelections($creator); |
38 | 38 | |
39 | - if (! $this->confirm('Do you wish to continue?', true)) { |
|
39 | + if (!$this->confirm('Do you wish to continue?', true)) { |
|
40 | 40 | $this->info('Aborting.'); |
41 | 41 | |
42 | 42 | return Command::USER_EXIT; |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | namespace { |
6 | 6 | use Hyde\Foundation\HydeKernel; |
7 | 7 | |
8 | - if (! function_exists('hyde')) { |
|
8 | + if (!function_exists('hyde')) { |
|
9 | 9 | /** |
10 | 10 | * Get the available HydeKernel instance. |
11 | 11 | */ |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | } |
16 | 16 | } |
17 | 17 | |
18 | - if (! function_exists('unslash')) { |
|
18 | + if (!function_exists('unslash')) { |
|
19 | 19 | /** |
20 | 20 | * Remove trailing slashes from the start and end of a string. |
21 | 21 | */ |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | use function app; |
40 | 40 | use function md5; |
41 | 41 | |
42 | - if (! function_exists('\Hyde\hyde')) { |
|
42 | + if (!function_exists('\Hyde\hyde')) { |
|
43 | 43 | /** |
44 | 44 | * Get the available HydeKernel instance. |
45 | 45 | */ |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - if (! function_exists('\Hyde\unslash')) { |
|
52 | + if (!function_exists('\Hyde\unslash')) { |
|
53 | 53 | /** |
54 | 54 | * Remove trailing slashes from the start and end of a string. |
55 | 55 | */ |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
62 | - if (! function_exists('\Hyde\unixsum')) { |
|
62 | + if (!function_exists('\Hyde\unixsum')) { |
|
63 | 63 | /** |
64 | 64 | * A EOL agnostic wrapper for calculating MD5 checksums. |
65 | 65 | * |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
74 | - if (! function_exists('\Hyde\unixsum_file')) { |
|
74 | + if (!function_exists('\Hyde\unixsum_file')) { |
|
75 | 75 | /** |
76 | 76 | * Shorthand for {@see unixsum()} but loads a file. |
77 | 77 | */ |
@@ -81,63 +81,63 @@ discard block |
||
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | - if (! function_exists('\Hyde\make_title')) { |
|
84 | + if (!function_exists('\Hyde\make_title')) { |
|
85 | 85 | function make_title(string $value): string |
86 | 86 | { |
87 | 87 | return hyde()->makeTitle($value); |
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | - if (! function_exists('\Hyde\normalize_newlines')) { |
|
91 | + if (!function_exists('\Hyde\normalize_newlines')) { |
|
92 | 92 | function normalize_newlines(string $string): string |
93 | 93 | { |
94 | 94 | return hyde()->normalizeNewlines($string); |
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
98 | - if (! function_exists('\Hyde\strip_newlines')) { |
|
98 | + if (!function_exists('\Hyde\strip_newlines')) { |
|
99 | 99 | function strip_newlines(string $string): string |
100 | 100 | { |
101 | 101 | return hyde()->stripNewlines($string); |
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
105 | - if (! function_exists('\Hyde\trim_slashes')) { |
|
105 | + if (!function_exists('\Hyde\trim_slashes')) { |
|
106 | 106 | function trim_slashes(string $string): string |
107 | 107 | { |
108 | 108 | return hyde()->trimSlashes($string); |
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | - if (! function_exists('\Hyde\evaluate_arrayable')) { |
|
112 | + if (!function_exists('\Hyde\evaluate_arrayable')) { |
|
113 | 113 | function evaluate_arrayable(array|Arrayable $array): array |
114 | 114 | { |
115 | 115 | return $array instanceof Arrayable ? $array->toArray() : $array; |
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
119 | - if (! function_exists('\Hyde\yaml_encode')) { |
|
119 | + if (!function_exists('\Hyde\yaml_encode')) { |
|
120 | 120 | function yaml_encode(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string |
121 | 121 | { |
122 | 122 | return Yaml::dump($input instanceof Arrayable ? $input->toArray() : $input, $inline, $indent, $flags); |
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | - if (! function_exists('\Hyde\yaml_decode')) { |
|
126 | + if (!function_exists('\Hyde\yaml_decode')) { |
|
127 | 127 | function yaml_decode(string $input, int $flags = 0): mixed |
128 | 128 | { |
129 | 129 | return Yaml::parse($input, $flags); |
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
133 | - if (! function_exists('\Hyde\path_join')) { |
|
133 | + if (!function_exists('\Hyde\path_join')) { |
|
134 | 134 | function path_join(string $directory, string ...$paths): string |
135 | 135 | { |
136 | 136 | return implode('/', array_merge([$directory], $paths)); |
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
140 | - if (! function_exists('\Hyde\normalize_slashes')) { |
|
140 | + if (!function_exists('\Hyde\normalize_slashes')) { |
|
141 | 141 | function normalize_slashes(string $string): string |
142 | 142 | { |
143 | 143 | return str_replace('\\', '/', $string); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** Get all the configuration files for the application. */ |
20 | 20 | protected function getConfigurationFiles(Application $app): array |
21 | 21 | { |
22 | - return tap(parent::getConfigurationFiles($app), function (array &$files) use ($app): void { |
|
22 | + return tap(parent::getConfigurationFiles($app), function(array &$files) use ($app): void { |
|
23 | 23 | // Inject our custom config file which is stored in `app/config.php`. |
24 | 24 | $files['app'] = $app->basePath().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'config.php'; |
25 | 25 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | // If we're running in a Phar and no project config directory exists, |
68 | 68 | // we need to adjust the path to use the bundled static Phar config file. |
69 | 69 | |
70 | - if (Phar::running() && (! is_dir($files['app']))) { |
|
70 | + if (Phar::running() && (!is_dir($files['app']))) { |
|
71 | 71 | $files['app'] = dirname(__DIR__, 6).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; |
72 | 72 | } |
73 | 73 | } |