@@ -12,7 +12,7 @@ |
||
| 12 | 12 | $lines = explode("\n", $markdown); |
| 13 | 13 | |
| 14 | 14 | foreach ($lines as $index => $line) { |
| 15 | - if (static::lineMatchesPattern($line) && ! str_contains($line, '{"shortcodes": false}')) { |
|
| 15 | + if (static::lineMatchesPattern($line) && !str_contains($line, '{"shortcodes": false}')) { |
|
| 16 | 16 | // Add the meta-block two lines before the pattern, placing it just above the code block. |
| 17 | 17 | // This prevents the meta-block from interfering with other processes. |
| 18 | 18 | $lines[$index - 2] .= sprintf( |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | public static function preprocess(string $markdown): string |
| 32 | 32 | { |
| 33 | - return implode("\n", array_map(function ($line) { |
|
| 33 | + return implode("\n", array_map(function($line) { |
|
| 34 | 34 | return str_starts_with(strtolower($line), strtolower('[Blade]:')) |
| 35 | 35 | ? '<!-- HYDE'.trim(htmlentities($line)).' -->' |
| 36 | 36 | : $line; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function run(): static |
| 52 | 52 | { |
| 53 | - $this->output = implode("\n", array_map(function ($line) { |
|
| 53 | + $this->output = implode("\n", array_map(function($line) { |
|
| 54 | 54 | return $this->lineStartsWithDirective($line) |
| 55 | 55 | ? $this->processLine($line) |
| 56 | 56 | : $line; |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | protected function formatOutputPath(string $path): string |
| 58 | 58 | { |
| 59 | - if (! file_exists(Hyde::sitePath($path))) { |
|
| 59 | + if (!file_exists(Hyde::sitePath($path))) { |
|
| 60 | 60 | return "_site/$path"; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function validate(): void |
| 99 | 99 | { |
| 100 | - if (! ( |
|
| 100 | + if (!( |
|
| 101 | 101 | str_starts_with($this->path, Hyde::pathToRelative(Hyde::getBladePagePath())) || |
| 102 | 102 | str_starts_with($this->path, Hyde::pathToRelative(Hyde::getMarkdownPagePath())) || |
| 103 | 103 | str_starts_with($this->path, Hyde::pathToRelative(Hyde::getMarkdownPostPath())) || |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | throw new Exception("Path [$this->path] is not in a valid source directory.", 400); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - if (! file_exists(Hyde::path($this->path))) { |
|
| 109 | + if (!file_exists(Hyde::path($this->path))) { |
|
| 110 | 110 | throw new Exception("File [$this->path] not found.", 404); |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $this->selected = $this->argument('homepage') ?? $this->promptForHomepage(); |
| 30 | 30 | |
| 31 | - if (! $this->canExistingIndexFileBeOverwritten()) { |
|
| 31 | + if (!$this->canExistingIndexFileBeOverwritten()) { |
|
| 32 | 32 | $this->error('A modified index.blade.php file already exists. Use --force to overwrite.'); |
| 33 | 33 | |
| 34 | 34 | return 409; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | protected function canExistingIndexFileBeOverwritten(): bool |
| 83 | 83 | { |
| 84 | - if (! file_exists(Hyde::getBladePagePath('index.blade.php')) || $this->option('force')) { |
|
| 84 | + if (!file_exists(Hyde::getBladePagePath('index.blade.php')) || $this->option('force')) { |
|
| 85 | 85 | return true; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | |
| 74 | 74 | public function failed(): bool |
| 75 | 75 | { |
| 76 | - return ! $this->passed; |
|
| 76 | + return !$this->passed; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | public function statusCode(): int |
@@ -235,7 +235,7 @@ |
||
| 235 | 235 | |
| 236 | 236 | public function showInNavigation(): bool |
| 237 | 237 | { |
| 238 | - return ! $this->navigation['hidden']; |
|
| 238 | + return !$this->navigation['hidden']; |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | public function navigationMenuPriority(): int |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function compileStaticPages(): void |
| 41 | 41 | { |
| 42 | - $this->getDiscoveredModels()->each(function (string $pageClass) { |
|
| 42 | + $this->getDiscoveredModels()->each(function(string $pageClass) { |
|
| 43 | 43 | $this->compilePagesForClass($pageClass); |
| 44 | 44 | }); |
| 45 | 45 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $this->withProgressBar( |
| 67 | 67 | $collection, |
| 68 | - function ($filepath) { |
|
| 68 | + function($filepath) { |
|
| 69 | 69 | copy($filepath, Hyde::sitePath('media/'.basename($filepath))); |
| 70 | 70 | } |
| 71 | 71 | ); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | protected function getDiscoveredModels(): RouteCollection |
| 79 | 79 | { |
| 80 | - return $this->router->getRoutes()->map(function (Route $route) { |
|
| 80 | + return $this->router->getRoutes()->map(function(Route $route) { |
|
| 81 | 81 | return $route->getPageClass(); |
| 82 | 82 | })->unique(); |
| 83 | 83 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | /** @psalm-return \Closure(\Hyde\Support\Models\Route):string */ |
| 100 | 100 | protected function compileRoute(): Closure |
| 101 | 101 | { |
| 102 | - return function (Route $route) { |
|
| 102 | + return function(Route $route) { |
|
| 103 | 103 | return (new StaticPageBuilder($route->getPage()))->__invoke(); |
| 104 | 104 | }; |
| 105 | 105 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | protected function isItSafeToCleanOutputDirectory(): bool |
| 113 | 113 | { |
| 114 | - if (! $this->isOutputDirectoryWhitelisted() && ! $this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
| 114 | + if (!$this->isOutputDirectoryWhitelisted() && !$this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
| 115 | 115 | $this->info('Output directory will not be emptied.'); |
| 116 | 116 | |
| 117 | 117 | return false; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function addExtension(string $extensionClassName): void |
| 56 | 56 | { |
| 57 | - if (! in_array($extensionClassName, $this->extensions)) { |
|
| 57 | + if (!in_array($extensionClassName, $this->extensions)) { |
|
| 58 | 58 | $this->extensions[] = $extensionClassName; |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | public function addFeature(string $feature): static |
| 158 | 158 | { |
| 159 | - if (! in_array($feature, $this->features)) { |
|
| 159 | + if (!in_array($feature, $this->features)) { |
|
| 160 | 160 | $this->features[] = $feature; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | protected function determineIfTorchlightAttributionShouldBeInjected(): bool |
| 210 | 210 | { |
| 211 | - return ! $this->isDocumentationPage() |
|
| 211 | + return !$this->isDocumentationPage() |
|
| 212 | 212 | && config('torchlight.attribution.enabled', true) |
| 213 | 213 | && str_contains($this->html, 'Syntax highlighted by torchlight.dev'); |
| 214 | 214 | } |