@@ -35,7 +35,7 @@ |
||
35 | 35 | /** @return \Hyde\Foundation\Kernel\PageCollection<\Hyde\Pages\MarkdownPost> */ |
36 | 36 | public static function getLatestPosts(): PageCollection |
37 | 37 | { |
38 | - return static::all()->sortByDesc(function (self $post): int { |
|
38 | + return static::all()->sortByDesc(function(self $post): int { |
|
39 | 39 | return $post->date?->dateTimeObject->getTimestamp() ?? 0; |
40 | 40 | }); |
41 | 41 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public static function files(): array |
135 | 135 | { |
136 | - return Files::getFiles(static::class)->map(function (SourceFile $file): string { |
|
136 | + return Files::getFiles(static::class)->map(function(SourceFile $file): string { |
|
137 | 137 | return static::pathToIdentifier($file->getPath()); |
138 | 138 | })->values()->toArray(); |
139 | 139 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | */ |
372 | 372 | public function showInNavigation(): bool |
373 | 373 | { |
374 | - return ! $this->navigation->hidden; |
|
374 | + return !$this->navigation->hidden; |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | /** |
@@ -400,11 +400,11 @@ discard block |
||
400 | 400 | |
401 | 401 | public function getCanonicalUrl(): ?string |
402 | 402 | { |
403 | - if (! empty($this->matter('canonicalUrl'))) { |
|
403 | + if (!empty($this->matter('canonicalUrl'))) { |
|
404 | 404 | return $this->matter('canonicalUrl'); |
405 | 405 | } |
406 | 406 | |
407 | - if (Hyde::hasSiteUrl() && ! empty($this->identifier)) { |
|
407 | + if (Hyde::hasSiteUrl() && !empty($this->identifier)) { |
|
408 | 408 | return Hyde::url($this->getOutputPath()); |
409 | 409 | } |
410 | 410 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | { |
26 | 26 | $app = Container::getInstance(); |
27 | 27 | |
28 | - if (! $app->bound(self::class)) { |
|
28 | + if (!$app->bound(self::class)) { |
|
29 | 29 | $app->singleton(self::class); |
30 | 30 | } |
31 | 31 |
@@ -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 trim; |
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); |
@@ -75,7 +75,7 @@ |
||
75 | 75 | /** @return \Illuminate\Support\Collection<string, \Hyde\Framework\Features\Blogging\Models\PostAuthor> */ |
76 | 76 | public static function all(): Collection |
77 | 77 | { |
78 | - return (new Collection(Config::getArray('hyde.authors', [])))->mapWithKeys(function (self $author): array { |
|
78 | + return (new Collection(Config::getArray('hyde.authors', [])))->mapWithKeys(function(self $author): array { |
|
79 | 79 | return [strtolower($author->username) => $author]; |
80 | 80 | }); |
81 | 81 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | // Reject any metadata from the global metadata bag that is already present in the page metadata bag. |
53 | 53 | |
54 | 54 | foreach (['links', 'metadata', 'properties', 'generics'] as $type) { |
55 | - $global->$type = array_filter((array) $global->$type, fn (Element $element): bool => ! in_array($element->uniqueKey(), |
|
55 | + $global->$type = array_filter((array) $global->$type, fn (Element $element): bool => !in_array($element->uniqueKey(), |
|
56 | 56 | array_map(fn (Element $element): string => $element->uniqueKey(), (array) $page->metadata->$type) |
57 | 57 | )); |
58 | 58 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | /** @param string[] $parameterNames */ |
89 | 89 | protected static function qualifyArguments(array $parameterNames, array $arguments): Collection |
90 | 90 | { |
91 | - return collect($arguments)->mapWithKeys(function (string|array|int|bool $argumentValue, int|string $key) use ($parameterNames): string|array|int|bool { |
|
91 | + return collect($arguments)->mapWithKeys(function(string|array|int|bool $argumentValue, int|string $key) use ($parameterNames): string|array|int|bool { |
|
92 | 92 | $argumentsToQualify = [ |
93 | 93 | 'path', 'paths', 'file', 'target', 'directory', 'destination', 'firstFile', 'secondFile', |
94 | 94 | 'pattern', 'link', 'from', 'to', |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | protected static function qualifyPathArgument(array|string $path): string|array |
111 | 111 | { |
112 | 112 | return is_array($path) |
113 | - ? array_map(fn (string $path): string => self::qualifyPathArgument($path), $path) |
|
113 | + ? array_map(fn (string $path) : string => self::qualifyPathArgument($path), $path) |
|
114 | 114 | : self::absolutePath($path); |
115 | 115 | } |
116 | 116 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** Get all the configuration files for the application. */ |
22 | 22 | protected function getConfigurationFiles(Application $app): array |
23 | 23 | { |
24 | - return (array) tap(parent::getConfigurationFiles($app), function (array &$files) use ($app): void { |
|
24 | + return (array) tap(parent::getConfigurationFiles($app), function(array &$files) use ($app): void { |
|
25 | 25 | // Inject our custom config file which is stored in `app/config.php`. |
26 | 26 | $files['app'] = $app->basePath().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'config.php'; |
27 | 27 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | // we need to adjust the path to use the bundled static Phar config file. |
74 | 74 | |
75 | 75 | /** @var array{app: string} $files */ |
76 | - if (Phar::running() && (! is_dir($files['app']))) { |
|
76 | + if (Phar::running() && (!is_dir($files['app']))) { |
|
77 | 77 | $files['app'] = dirname(__DIR__, 6).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; |
78 | 78 | } |
79 | 79 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | // the default LoadConfiguration bootstrapper class with our implementation. |
29 | 29 | // We do this by swapping out the LoadConfiguration class with our own. |
30 | 30 | |
31 | - return array_values((array) tap(array_combine($bootstrappers, $bootstrappers), function (array &$array): void { |
|
31 | + return array_values((array) tap(array_combine($bootstrappers, $bootstrappers), function(array &$array): void { |
|
32 | 32 | $array[\LaravelZero\Framework\Bootstrap\LoadConfiguration::class] = \Hyde\Foundation\Internal\LoadConfiguration::class; |
33 | 33 | })); |
34 | 34 | } |