@@ -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 | )); |
@@ -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 |
@@ -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 | */ |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | use Illuminate\Contracts\Support\Arrayable; |
32 | 32 | use Symfony\Component\Yaml\Yaml; |
33 | 33 | |
34 | - if (! function_exists('\Hyde\hyde')) { |
|
34 | + if (!function_exists('\Hyde\hyde')) { |
|
35 | 35 | /** |
36 | 36 | * Get the available HydeKernel instance. |
37 | 37 | */ |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | - if (! function_exists('\Hyde\unslash')) { |
|
44 | + if (!function_exists('\Hyde\unslash')) { |
|
45 | 45 | /** |
46 | 46 | * Remove trailing slashes from the start and end of a string. |
47 | 47 | */ |
@@ -51,49 +51,49 @@ discard block |
||
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | - if (! function_exists('\Hyde\make_title')) { |
|
54 | + if (!function_exists('\Hyde\make_title')) { |
|
55 | 55 | function make_title(string $value): string |
56 | 56 | { |
57 | 57 | return hyde()->makeTitle($value); |
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | - if (! function_exists('\Hyde\normalize_newlines')) { |
|
61 | + if (!function_exists('\Hyde\normalize_newlines')) { |
|
62 | 62 | function normalize_newlines(string $string): string |
63 | 63 | { |
64 | 64 | return hyde()->normalizeNewlines($string); |
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | - if (! function_exists('\Hyde\strip_newlines')) { |
|
68 | + if (!function_exists('\Hyde\strip_newlines')) { |
|
69 | 69 | function strip_newlines(string $string): string |
70 | 70 | { |
71 | 71 | return hyde()->stripNewlines($string); |
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | - if (! function_exists('\Hyde\trim_slashes')) { |
|
75 | + if (!function_exists('\Hyde\trim_slashes')) { |
|
76 | 76 | function trim_slashes(string $string): string |
77 | 77 | { |
78 | 78 | return hyde()->trimSlashes($string); |
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | - if (! function_exists('\Hyde\evaluate_arrayable')) { |
|
82 | + if (!function_exists('\Hyde\evaluate_arrayable')) { |
|
83 | 83 | function evaluate_arrayable(array|Arrayable $array): array |
84 | 84 | { |
85 | 85 | return $array instanceof Arrayable ? $array->toArray() : $array; |
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
89 | - if (! function_exists('\Hyde\yaml_encode')) { |
|
89 | + if (!function_exists('\Hyde\yaml_encode')) { |
|
90 | 90 | function yaml_encode(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string |
91 | 91 | { |
92 | 92 | return Yaml::dump($input instanceof Arrayable ? $input->toArray() : $input, $inline, $indent, $flags); |
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | - if (! function_exists('\Hyde\yaml_decode')) { |
|
96 | + if (!function_exists('\Hyde\yaml_decode')) { |
|
97 | 97 | function yaml_decode(string $input, int $flags = 0): mixed |
98 | 98 | { |
99 | 99 | return Yaml::parse($input, $flags); |