@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public const FEATURED_IMAGE_SCHEMA = [ |
| 16 | 16 | 'source' => 'string', // Name of a file in _media/ or a remote URL (required) |
| 17 | 17 | 'altText' => 'string', // The alt text (important for accessibility) |
| 18 | - 'alt' => 'string', // Alternative to altText (simplified schema) |
|
| 18 | + 'alt' => 'string', // Alternative to altText (simplified schema) |
|
| 19 | 19 | 'titleText' => 'string', // The title text (hover tooltip & metadata) |
| 20 | 20 | 'caption' => 'string', // The caption text (simplified schema) |
| 21 | 21 | 'licenseName' => 'string', // The name of the license (e.g. "CC BY 4.0") |
@@ -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 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | protected function getEnvironmentVariables(): array |
| 97 | 97 | { |
| 98 | 98 | return Arr::whereNotNull([ |
| 99 | - 'HYDE_SERVER_REQUEST_OUTPUT' => ! $this->option('no-ansi'), |
|
| 99 | + 'HYDE_SERVER_REQUEST_OUTPUT' => !$this->option('no-ansi'), |
|
| 100 | 100 | 'HYDE_SERVER_SAVE_PREVIEW' => $this->parseEnvironmentOption('save-preview'), |
| 101 | 101 | 'HYDE_SERVER_DASHBOARD' => $this->parseEnvironmentOption('dashboard'), |
| 102 | 102 | 'HYDE_PRETTY_URLS' => $this->parseEnvironmentOption('pretty-urls'), |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | protected function configureOutput(): void |
| 108 | 108 | { |
| 109 | - if (! $this->useBasicOutput()) { |
|
| 109 | + if (!$this->useBasicOutput()) { |
|
| 110 | 110 | $this->console = new ConsoleOutput($this->output->isVerbose()); |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -120,14 +120,14 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | protected function getOutputHandler(): Closure |
| 122 | 122 | { |
| 123 | - return $this->useBasicOutput() ? function (string $type, string $line): void { |
|
| 123 | + return $this->useBasicOutput() ? function(string $type, string $line): void { |
|
| 124 | 124 | $this->output->write($line); |
| 125 | 125 | } : $this->console->getFormatter(); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | protected function useBasicOutput(): bool |
| 129 | 129 | { |
| 130 | - return $this->option('no-ansi') || ! class_exists(ConsoleOutput::class); |
|
| 130 | + return $this->option('no-ansi') || !class_exists(ConsoleOutput::class); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | protected function parseEnvironmentOption(string $name): ?string |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | $process = $binary ? Process::command($command)->run() : null; |
| 168 | 168 | |
| 169 | - if (! $process || $process->failed()) { |
|
| 169 | + if (!$process || $process->failed()) { |
|
| 170 | 170 | $this->warn('Unable to open the site preview in the browser on your system:'); |
| 171 | 171 | $this->line(sprintf(' %s', str_replace("\n", "\n ", $process ? $process->errorOutput() : "Missing suitable 'open' binary."))); |
| 172 | 172 | $this->newLine(); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | protected function runViteProcess(): void |
| 187 | 187 | { |
| 188 | - if (! $this->isPortAvailable(5173)) { |
|
| 188 | + if (!$this->isPortAvailable(5173)) { |
|
| 189 | 189 | throw new InvalidArgumentException( |
| 190 | 190 | 'Unable to start Vite server: Port 5173 is already in use. '. |
| 191 | 191 | 'Please stop any other Vite processes and try again.' |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | while ($this->server->running()) { |
| 203 | 203 | $this->handleViteOutput(); |
| 204 | 204 | |
| 205 | - Sleep::for(100)->milliseconds(); |
|
| 205 | + Sleep::for (100)->milliseconds(); |
|
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
@@ -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 | |