@@ -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 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | |
| 51 | 51 | protected function getCacheBustKey(string $file): string |
| 52 | 52 | { |
| 53 | - if (! config('hyde.cache_busting', true)) { |
|
| 53 | + if (!config('hyde.cache_busting', true)) { |
|
| 54 | 54 | return ''; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | public function check_documentation_site_has_an_index_page(Result $result): Result |
| 65 | 65 | { |
| 66 | - if (! Features::hasDocumentationPages()) { |
|
| 66 | + if (!Features::hasDocumentationPages()) { |
|
| 67 | 67 | return $result->skip('Does documentation site have an index page?') |
| 68 | 68 | ->withTip('Skipped because: The documentation page feature is disabled in config'); |
| 69 | 69 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | public function check_a_torchlight_api_token_is_set(Result $result): Result |
| 110 | 110 | { |
| 111 | - if (! Features::enabled(Features::torchlight())) { |
|
| 111 | + if (!Features::enabled(Features::torchlight())) { |
|
| 112 | 112 | return $result->skip('Check a Torchlight API token is set') |
| 113 | 113 | ->withTip('Torchlight is an API for code syntax highlighting. You can enable it in the Hyde config.'); |
| 114 | 114 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function __construct() |
| 29 | 29 | { |
| 30 | - if (! extension_loaded('simplexml') || config('testing.mock_disabled_extensions', false) === true) { |
|
| 30 | + if (!extension_loaded('simplexml') || config('testing.mock_disabled_extensions', false) === true) { |
|
| 31 | 31 | throw new Exception('The ext-simplexml extension is not installed, but is required to generate RSS feeds.'); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function generate(): static |
| 41 | 41 | { |
| 42 | - \Hyde\Facades\Route::all()->each(function ($route) { |
|
| 42 | + \Hyde\Facades\Route::all()->each(function($route) { |
|
| 43 | 43 | $this->addRoute($route); |
| 44 | 44 | }); |
| 45 | 45 | |
@@ -36,12 +36,12 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public static function getSourceFileListForModel(string $model): array |
| 38 | 38 | { |
| 39 | - if (! class_exists($model) || ! is_subclass_of($model, HydePage::class)) { |
|
| 39 | + if (!class_exists($model) || !is_subclass_of($model, HydePage::class)) { |
|
| 40 | 40 | throw new UnsupportedPageTypeException($model); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $files = []; |
| 44 | - Hyde::files()->getSourceFiles($model)->each(function (File $file) use (&$files, $model) { |
|
| 44 | + Hyde::files()->getSourceFiles($model)->each(function(File $file) use (&$files, $model) { |
|
| 45 | 45 | $files[] = self::formatSlugForModel($model, $file->withoutDirectoryPrefix()); |
| 46 | 46 | }); |
| 47 | 47 | |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | { |
| 59 | 59 | /** @var \Hyde\Pages\DocumentationPage $page */ |
| 60 | 60 | foreach (DocumentationPage::all() as $page) { |
| 61 | - if (! in_array($page->identifier, config('docs.exclude_from_search', []))) { |
|
| 61 | + if (!in_array($page->identifier, config('docs.exclude_from_search', []))) { |
|
| 62 | 62 | $this->searchIndex->push( |
| 63 | 63 | $this->generatePageEntry($page) |
| 64 | 64 | ); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function __construct() |
| 25 | 25 | { |
| 26 | - if (! extension_loaded('simplexml') || config('testing.mock_disabled_extensions', false) === true) { |
|
| 26 | + if (!extension_loaded('simplexml') || config('testing.mock_disabled_extensions', false) === true) { |
|
| 27 | 27 | throw new Exception('The ext-simplexml extension is not installed, but is required to generate RSS feeds.'); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | protected static function xmlEscape(string $string): string |
| 112 | 112 | { |
| 113 | - return htmlspecialchars($string, ENT_XML1 | ENT_COMPAT, 'UTF-8'); |
|
| 113 | + return htmlspecialchars($string, ENT_XML1|ENT_COMPAT, 'UTF-8'); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | public static function getDescription(): string |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | $this->app->singleton(AssetService::class, AssetService::class); |
| 34 | 34 | |
| 35 | - $this->app->singleton(MarkdownConverter::class, function () { |
|
| 35 | + $this->app->singleton(MarkdownConverter::class, function() { |
|
| 36 | 36 | return new MarkdownConverter(); |
| 37 | 37 | }); |
| 38 | 38 | |