@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | public function compileStaticPages(): void |
36 | 36 | { |
37 | - $this->getDiscoveredModels()->each(function (string $pageClass) { |
|
37 | + $this->getDiscoveredModels()->each(function(string $pageClass) { |
|
38 | 38 | $this->compilePagesForClass($pageClass); |
39 | 39 | }); |
40 | 40 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $this->comment('Transferring Media Assets...'); |
60 | 60 | |
61 | 61 | $this->withProgressBar($collection, |
62 | - function ($filepath) { |
|
62 | + function($filepath) { |
|
63 | 63 | copy($filepath, Hyde::getSiteOutputPath('media/'.basename($filepath))); |
64 | 64 | } |
65 | 65 | ); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | protected function getDiscoveredModels(): Collection |
70 | 70 | { |
71 | - return $this->router->getRoutes()->map(function (Route $route) { |
|
71 | + return $this->router->getRoutes()->map(function(Route $route) { |
|
72 | 72 | return $route->getPageType(); |
73 | 73 | })->unique(); |
74 | 74 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | protected function compileRoute(): \Closure |
90 | 90 | { |
91 | - return function (Route $route) { |
|
91 | + return function(Route $route) { |
|
92 | 92 | return (new StaticPageBuilder($route->getSourceModel()))->__invoke(); |
93 | 93 | }; |
94 | 94 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | protected function isItSafeToCleanOutputDirectory(): bool |
102 | 102 | { |
103 | - if (! $this->isOutputDirectoryWhitelisted() && ! $this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
103 | + if (!$this->isOutputDirectoryWhitelisted() && !$this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
104 | 104 | $this->info('Output directory will not be emptied.'); |
105 | 105 | |
106 | 106 | return false; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | public function generate(): self |
33 | 33 | { |
34 | - Route::all()->each(function ($route) { |
|
34 | + Route::all()->each(function($route) { |
|
35 | 35 | $this->addRoute($route); |
36 | 36 | }); |
37 | 37 |
@@ -107,7 +107,7 @@ |
||
107 | 107 | { |
108 | 108 | if (! Features::enabled(Features::torchlight())) { |
109 | 109 | return $result->skip('Check a Torchlight API token is set') |
110 | - ->withTip('Torchlight is an API for code syntax highlighting. You can enable it in the Hyde config.'); |
|
110 | + ->withTip('Torchlight is an API for code syntax highlighting. You can enable it in the Hyde config.'); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | if (config('torchlight.token') !== null) { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | public function check_documentation_site_has_an_index_page(Result $result): Result |
64 | 64 | { |
65 | - if (! Features::hasDocumentationPages()) { |
|
65 | + if (!Features::hasDocumentationPages()) { |
|
66 | 66 | return $result->skip('The documentation page feature is disabled in config'); |
67 | 67 | } |
68 | 68 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | public function check_a_torchlight_api_token_is_set(Result $result): Result |
107 | 107 | { |
108 | - if (! Features::enabled(Features::torchlight())) { |
|
108 | + if (!Features::enabled(Features::torchlight())) { |
|
109 | 109 | return $result->skip('Check a Torchlight API token is set') |
110 | 110 | ->withTip('Torchlight is an API for code syntax highlighting. You can enable it in the Hyde config.'); |
111 | 111 | } |
@@ -26,13 +26,13 @@ |
||
26 | 26 | */ |
27 | 27 | public static function getSourceFileListForModel(string $model): array|false |
28 | 28 | { |
29 | - if (! class_exists($model) || ! is_subclass_of($model, AbstractPage::class)) { |
|
29 | + if (!class_exists($model) || !is_subclass_of($model, AbstractPage::class)) { |
|
30 | 30 | return false; |
31 | 31 | } |
32 | 32 | |
33 | 33 | $files = []; |
34 | 34 | foreach (glob(Hyde::path($model::qualifyBasename('*'))) as $filepath) { |
35 | - if (! str_starts_with(basename($filepath), '_')) { |
|
35 | + if (!str_starts_with(basename($filepath), '_')) { |
|
36 | 36 | $files[] = basename($filepath, $model::getFileExtension()); |
37 | 37 | } |
38 | 38 | } |
@@ -109,7 +109,7 @@ |
||
109 | 109 | |
110 | 110 | protected static function xmlEscape(string $string): string |
111 | 111 | { |
112 | - return htmlspecialchars($string, ENT_XML1 | ENT_COMPAT, 'UTF-8'); |
|
112 | + return htmlspecialchars($string, ENT_XML1|ENT_COMPAT, 'UTF-8'); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | public static function getTitle(): string |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function getRoutesForModel(string $pageClass): Collection |
76 | 76 | { |
77 | 77 | // Return a new filtered collection with only routes that are for the given page class. |
78 | - return $this->routes->filter(function (RouteContract $route) use ($pageClass) { |
|
78 | + return $this->routes->filter(function(RouteContract $route) use ($pageClass) { |
|
79 | 79 | return $route->getSourceModel() instanceof $pageClass; |
80 | 80 | }); |
81 | 81 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | protected function discoverPageRoutes(string $pageClass): void |
126 | 126 | { |
127 | 127 | /** @var PageContract $pageClass */ |
128 | - $pageClass::all()->each(function ($page) { |
|
128 | + $pageClass::all()->each(function($page) { |
|
129 | 129 | $this->discover($page); |
130 | 130 | }); |
131 | 131 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | protected function withoutIndex(): self |
87 | 87 | { |
88 | - $this->sidebar = $this->sidebar->reject(function (DocumentationSidebarItem $item) { |
|
88 | + $this->sidebar = $this->sidebar->reject(function(DocumentationSidebarItem $item) { |
|
89 | 89 | return $item->destination === 'index'; |
90 | 90 | }); |
91 | 91 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | protected function withoutHidden(): self |
99 | 99 | { |
100 | - $this->sidebar = $this->sidebar->reject(function (DocumentationSidebarItem $item) { |
|
100 | + $this->sidebar = $this->sidebar->reject(function(DocumentationSidebarItem $item) { |
|
101 | 101 | return $item->isHidden(); |
102 | 102 | }); |
103 | 103 |
@@ -54,7 +54,7 @@ |
||
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 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $actionTime = microtime(true); |
38 | 38 | |
39 | - if (! $this->runPreflightCheck()) { |
|
39 | + if (!$this->runPreflightCheck()) { |
|
40 | 40 | return 1; |
41 | 41 | } |
42 | 42 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | protected function runPreflightCheck(): bool |
51 | 51 | { |
52 | - if (! SitemapService::canGenerateSitemap()) { |
|
52 | + if (!SitemapService::canGenerateSitemap()) { |
|
53 | 53 | $this->error('Cannot generate sitemap.xml, please check your configuration.'); |
54 | 54 | |
55 | 55 | if ((Hyde::uriPath() === false)) { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $this->warn('Hint: You have disabled sitemap generation in config/hyde.php'); |
60 | 60 | $this->line(' > You can enable sitemap generation by setting <info>`site.generate_sitemap`</> to <info>`true`</>'); |
61 | 61 | } |
62 | - if (! extension_loaded('simplexml') || config('testing.mock_disabled_extensions', false) === true) { |
|
62 | + if (!extension_loaded('simplexml') || config('testing.mock_disabled_extensions', false) === true) { |
|
63 | 63 | $this->warn('Hint: You don\'t have the <info>`simplexml`</> extension installed. Check your PHP installation.'); |
64 | 64 | } |
65 | 65 |