@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function render(Node $node, ChildNodeRendererInterface $childRenderer): string |
| 37 | 37 | { |
| 38 | - if (! ($node instanceof Heading)) { |
|
| 38 | + if (!($node instanceof Heading)) { |
|
| 39 | 39 | throw new \InvalidArgumentException('Incompatible node type: '.get_class($node)); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | return config('markdown.permalinks.enabled', true) |
| 59 | 59 | && $level >= config('markdown.permalinks.min_level', 2) |
| 60 | 60 | && $level <= config('markdown.permalinks.max_level', 6) |
| 61 | - && ! str_contains($content, 'class="heading-permalink"') |
|
| 61 | + && !str_contains($content, 'class="heading-permalink"') |
|
| 62 | 62 | && in_array($this->pageClass, config('markdown.permalinks.pages', [DocumentationPage::class])); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | class DynamicMarkdownLinkProcessor implements MarkdownPostProcessorContract |
| 13 | 13 | { |
| 14 | 14 | /** @var array<string, \Hyde\Support\Filesystem\MediaFile>|null */ |
| 15 | - protected static ?array $assetMapCache = null; |
|
| 15 | + protected static ? array $assetMapCache = null; |
|
| 16 | 16 | |
| 17 | 17 | public static function postprocess(string $html): string |
| 18 | 18 | { |
@@ -27,14 +27,14 @@ |
||
| 27 | 27 | $driverTargetPath = $this->getDriverTargetPath(); |
| 28 | 28 | $driverSourcePath = Hyde::vendorPath('resources/stubs/HydeValetDriver.php', 'realtime-compiler'); |
| 29 | 29 | |
| 30 | - if (! is_dir(dirname($driverTargetPath))) { |
|
| 30 | + if (!is_dir(dirname($driverTargetPath))) { |
|
| 31 | 31 | $this->error('Herd Valet drivers directory not found. Is Herd installed?'); |
| 32 | 32 | |
| 33 | 33 | return Command::FAILURE; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (file_exists($driverTargetPath) && ! $this->option('force')) { |
|
| 37 | - if (! $this->confirm('The HydePHP Valet driver for Herd already exists. Do you want to overwrite it?', true)) { |
|
| 36 | + if (file_exists($driverTargetPath) && !$this->option('force')) { |
|
| 37 | + if (!$this->confirm('The HydePHP Valet driver for Herd already exists. Do you want to overwrite it?', true)) { |
|
| 38 | 38 | $this->info('Installation cancelled.'); |
| 39 | 39 | |
| 40 | 40 | return Command::SUCCESS; |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | 'Source Root' => $hydeConfig['source_root'] ?: '(Project Root)', |
| 78 | 78 | ], |
| 79 | 79 | 'Features' => [ |
| 80 | - 'Enabled Features' => implode(', ', array_map(function ($feature) { |
|
| 80 | + 'Enabled Features' => implode(', ', array_map(function($feature) { |
|
| 81 | 81 | return $feature->name; |
| 82 | 82 | }, $hydeConfig['features'] ?? [])), |
| 83 | 83 | ], |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | /** @return \Hyde\Foundation\Kernel\PageCollection<\Hyde\Pages\MarkdownPost> */ |
| 37 | 37 | public static function getLatestPosts(): PageCollection |
| 38 | 38 | { |
| 39 | - return static::all()->sortByDesc(function (self $post): int { |
|
| 39 | + return static::all()->sortByDesc(function(self $post): int { |
|
| 40 | 40 | return $post->date?->getTimestamp() ?? 0; |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -202,7 +202,9 @@ |
||
| 202 | 202 | while ($this->server->running()) { |
| 203 | 203 | $this->handleViteOutput(); |
| 204 | 204 | |
| 205 | - Sleep::for(100)->milliseconds(); |
|
| 205 | + Sleep::for(100) { |
|
| 206 | + ->milliseconds(); |
|
| 207 | + } |
|
| 206 | 208 | } |
| 207 | 209 | } |
| 208 | 210 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | protected function getEnvironmentVariables(): array |
| 102 | 102 | { |
| 103 | 103 | return Arr::whereNotNull([ |
| 104 | - 'HYDE_SERVER_REQUEST_OUTPUT' => ! $this->option('no-ansi'), |
|
| 104 | + 'HYDE_SERVER_REQUEST_OUTPUT' => !$this->option('no-ansi'), |
|
| 105 | 105 | 'HYDE_SERVER_SAVE_PREVIEW' => $this->parseEnvironmentOption('save-preview'), |
| 106 | 106 | 'HYDE_SERVER_DASHBOARD' => $this->parseEnvironmentOption('dashboard'), |
| 107 | 107 | 'HYDE_PRETTY_URLS' => $this->parseEnvironmentOption('pretty-urls'), |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | protected function configureOutput(): void |
| 113 | 113 | { |
| 114 | - if (! $this->useBasicOutput()) { |
|
| 114 | + if (!$this->useBasicOutput()) { |
|
| 115 | 115 | $this->console = new ConsoleOutput($this->output->isVerbose()); |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -125,14 +125,14 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | protected function getOutputHandler(): Closure |
| 127 | 127 | { |
| 128 | - return $this->useBasicOutput() ? function (string $type, string $line): void { |
|
| 128 | + return $this->useBasicOutput() ? function(string $type, string $line): void { |
|
| 129 | 129 | $this->output->write($line); |
| 130 | 130 | } : $this->console->getFormatter(); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | protected function useBasicOutput(): bool |
| 134 | 134 | { |
| 135 | - return $this->option('no-ansi') || ! class_exists(ConsoleOutput::class); |
|
| 135 | + return $this->option('no-ansi') || !class_exists(ConsoleOutput::class); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | protected function parseEnvironmentOption(string $name): ?string |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | $process = $binary ? Process::command($command)->run() : null; |
| 173 | 173 | |
| 174 | - if (! $process || $process->failed()) { |
|
| 174 | + if (!$process || $process->failed()) { |
|
| 175 | 175 | $this->warn('Unable to open the site preview in the browser on your system:'); |
| 176 | 176 | $this->line(sprintf(' %s', str_replace("\n", "\n ", $process ? $process->errorOutput() : "Missing suitable 'open' binary."))); |
| 177 | 177 | $this->newLine(); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | protected function runViteProcess(): void |
| 192 | 192 | { |
| 193 | - if (! $this->isPortAvailable(5173)) { |
|
| 193 | + if (!$this->isPortAvailable(5173)) { |
|
| 194 | 194 | throw new InvalidArgumentException( |
| 195 | 195 | 'Unable to start Vite server: Port 5173 is already in use. '. |
| 196 | 196 | 'Please stop any other Vite processes and try again.' |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | while ($this->server->running()) { |
| 216 | 216 | $this->handleViteOutput(); |
| 217 | 217 | |
| 218 | - Sleep::for(100)->milliseconds(); |
|
| 218 | + Sleep::for (100)->milliseconds(); |
|
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | |
| 259 | 259 | protected function ensureNodeModulesAvailable(): void |
| 260 | 260 | { |
| 261 | - if (! $this->nodeModulesInstalled()) { |
|
| 261 | + if (!$this->nodeModulesInstalled()) { |
|
| 262 | 262 | if ($this->input->isInteractive()) { |
| 263 | 263 | $this->warn('Node modules are not installed. Vite requires Node dependencies to function.'); |
| 264 | 264 | |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $this->info('Node modules installed successfully.'); |
| 299 | 299 | |
| 300 | - if (! $this->nodeModulesInstalled()) { |
|
| 300 | + if (!$this->nodeModulesInstalled()) { |
|
| 301 | 301 | throw new InvalidArgumentException( |
| 302 | 302 | 'Node modules installation completed but dependencies are still not available.' |
| 303 | 303 | ); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public const BLOG_POST_SCHEMA = [ |
| 16 | 16 | 'title' => 'string', |
| 17 | - 'description' => 'string', // Excerpt is also supported |
|
| 17 | + 'description' => 'string', // Excerpt is also supported |
|
| 18 | 18 | 'category' => 'string', |
| 19 | 19 | 'date' => 'string', |
| 20 | 20 | 'author' => ['string', AuthorSchema::AUTHOR_SCHEMA], |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | use Hyde\Foundation\HydeKernel; |
| 7 | 7 | use Hyde\Support\Filesystem\MediaFile; |
| 8 | 8 | |
| 9 | - if (! function_exists('hyde')) { |
|
| 9 | + if (!function_exists('hyde')) { |
|
| 10 | 10 | /** |
| 11 | 11 | * Get the available HydeKernel instance. |
| 12 | 12 | */ |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | if (defined('HYDE_COMPATIBILITY_MODE') && HYDE_COMPATIBILITY_MODE === true) { |
| 20 | 20 | // Don't declare these functions when running in compatibility mode. |
| 21 | 21 | } else { |
| 22 | - if (! function_exists('asset')) { |
|
| 22 | + if (!function_exists('asset')) { |
|
| 23 | 23 | /** |
| 24 | 24 | * Gets a MediaAsset instance for the given file stored in the `_site/media` folder. |
| 25 | 25 | * The returned value can be cast into a string in Blade views to resole the URL. |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - if (! function_exists('route')) { |
|
| 38 | + if (!function_exists('route')) { |
|
| 39 | 39 | /** |
| 40 | 40 | * Get a page route instance by its key. Casting it to a string will return a relative link to the page. |
| 41 | 41 | */ |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if (! function_exists('url')) { |
|
| 48 | + if (!function_exists('url')) { |
|
| 49 | 49 | /** |
| 50 | 50 | * Get a qualified URL to the supplied path if a base URL is set. |
| 51 | 51 | */ |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | use function trim; |
| 71 | 71 | use function md5; |
| 72 | 72 | |
| 73 | - if (! function_exists('\Hyde\hyde')) { |
|
| 73 | + if (!function_exists('\Hyde\hyde')) { |
|
| 74 | 74 | /** |
| 75 | 75 | * Get the available HydeKernel instance. |
| 76 | 76 | */ |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if (! function_exists('\Hyde\unslash')) { |
|
| 83 | + if (!function_exists('\Hyde\unslash')) { |
|
| 84 | 84 | /** |
| 85 | 85 | * Remove trailing slashes from the start and end of a string. |
| 86 | 86 | */ |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if (! function_exists('\Hyde\unixsum')) { |
|
| 93 | + if (!function_exists('\Hyde\unixsum')) { |
|
| 94 | 94 | /** |
| 95 | 95 | * A EOL agnostic wrapper for calculating MD5 checksums. |
| 96 | 96 | * |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - if (! function_exists('\Hyde\unixsum_file')) { |
|
| 105 | + if (!function_exists('\Hyde\unixsum_file')) { |
|
| 106 | 106 | /** |
| 107 | 107 | * Shorthand for {@see unixsum()} but loads a file. |
| 108 | 108 | */ |
@@ -112,70 +112,70 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - if (! function_exists('\Hyde\make_title')) { |
|
| 115 | + if (!function_exists('\Hyde\make_title')) { |
|
| 116 | 116 | function make_title(string $value): string |
| 117 | 117 | { |
| 118 | 118 | return hyde()->makeTitle($value); |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if (! function_exists('\Hyde\title')) { |
|
| 122 | + if (!function_exists('\Hyde\title')) { |
|
| 123 | 123 | function title(string $value): string |
| 124 | 124 | { |
| 125 | 125 | return hyde()->makeTitle($value); |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - if (! function_exists('\Hyde\normalize_newlines')) { |
|
| 129 | + if (!function_exists('\Hyde\normalize_newlines')) { |
|
| 130 | 130 | function normalize_newlines(string $string): string |
| 131 | 131 | { |
| 132 | 132 | return hyde()->normalizeNewlines($string); |
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if (! function_exists('\Hyde\strip_newlines')) { |
|
| 136 | + if (!function_exists('\Hyde\strip_newlines')) { |
|
| 137 | 137 | function strip_newlines(string $string): string |
| 138 | 138 | { |
| 139 | 139 | return hyde()->stripNewlines($string); |
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - if (! function_exists('\Hyde\trim_slashes')) { |
|
| 143 | + if (!function_exists('\Hyde\trim_slashes')) { |
|
| 144 | 144 | function trim_slashes(string $string): string |
| 145 | 145 | { |
| 146 | 146 | return hyde()->trimSlashes($string); |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - if (! function_exists('\Hyde\evaluate_arrayable')) { |
|
| 150 | + if (!function_exists('\Hyde\evaluate_arrayable')) { |
|
| 151 | 151 | function evaluate_arrayable(array|Arrayable $array): array |
| 152 | 152 | { |
| 153 | 153 | return $array instanceof Arrayable ? $array->toArray() : $array; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if (! function_exists('\Hyde\yaml_encode')) { |
|
| 157 | + if (!function_exists('\Hyde\yaml_encode')) { |
|
| 158 | 158 | function yaml_encode(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string |
| 159 | 159 | { |
| 160 | 160 | return Yaml::dump($input instanceof Arrayable ? $input->toArray() : $input, $inline, $indent, $flags); |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - if (! function_exists('\Hyde\yaml_decode')) { |
|
| 164 | + if (!function_exists('\Hyde\yaml_decode')) { |
|
| 165 | 165 | function yaml_decode(string $input, int $flags = 0): mixed |
| 166 | 166 | { |
| 167 | 167 | return Yaml::parse($input, $flags); |
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - if (! function_exists('\Hyde\path_join')) { |
|
| 171 | + if (!function_exists('\Hyde\path_join')) { |
|
| 172 | 172 | function path_join(string $directory, string ...$paths): string |
| 173 | 173 | { |
| 174 | 174 | return implode('/', array_merge([$directory], $paths)); |
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - if (! function_exists('\Hyde\normalize_slashes')) { |
|
| 178 | + if (!function_exists('\Hyde\normalize_slashes')) { |
|
| 179 | 179 | function normalize_slashes(string $string): string |
| 180 | 180 | { |
| 181 | 181 | return str_replace('\\', '/', $string); |