@@ -119,7 +119,7 @@ |
||
119 | 119 | |
120 | 120 | protected function processInput(): static |
121 | 121 | { |
122 | - $this->output = implode("\n", array_map(function (string $line): string { |
|
122 | + $this->output = implode("\n", array_map(function(string $line): string { |
|
123 | 123 | return $this->expandShortcode($line); |
124 | 124 | }, explode("\n", $this->input))); |
125 | 125 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | static::needsDirectory(static::$sourceDirectory); |
50 | 50 | |
51 | - return new static(DataCollections::findFiles($name, 'md')->mapWithKeys(function (string $file): array { |
|
51 | + return new static(DataCollections::findFiles($name, 'md')->mapWithKeys(function(string $file): array { |
|
52 | 52 | return [static::makeIdentifier($file) => MarkdownFileParser::parse($file)]; |
53 | 53 | })); |
54 | 54 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | static::needsDirectory(static::$sourceDirectory); |
66 | 66 | |
67 | - return new static(DataCollections::findFiles($name, ['yaml', 'yml'])->mapWithKeys(function (string $file): array { |
|
67 | + return new static(DataCollections::findFiles($name, ['yaml', 'yml'])->mapWithKeys(function(string $file): array { |
|
68 | 68 | return [static::makeIdentifier($file) => MarkdownFileParser::parse($file)->matter()]; |
69 | 69 | })); |
70 | 70 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | static::needsDirectory(static::$sourceDirectory); |
82 | 82 | |
83 | - return new static(DataCollections::findFiles($name, 'json')->mapWithKeys(function (string $file) use ($asArray): array { |
|
83 | + return new static(DataCollections::findFiles($name, 'json')->mapWithKeys(function(string $file) use ($asArray): array { |
|
84 | 84 | return [static::makeIdentifier($file) => json_decode(Filesystem::get($file), $asArray)]; |
85 | 85 | })); |
86 | 86 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | $path = static::path($filename); |
26 | 26 | |
27 | - if (! file_exists($path)) { |
|
27 | + if (!file_exists($path)) { |
|
28 | 28 | return $default; |
29 | 29 | } |
30 | 30 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $path = static::path(basename($filename, '.md').'.md'); |
38 | 38 | |
39 | - if (! file_exists($path)) { |
|
39 | + if (!file_exists($path)) { |
|
40 | 40 | return $default === null ? null : Markdown::render($default); |
41 | 41 | } |
42 | 42 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $path = static::path(basename($filename, '.blade.php').'.blade.php'); |
50 | 50 | |
51 | - if (! file_exists($path)) { |
|
51 | + if (!file_exists($path)) { |
|
52 | 52 | return $default === null ? null : Blade::render($default); |
53 | 53 | } |
54 | 54 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | protected static function needsDirectory(string $directory): void |
59 | 59 | { |
60 | - if (! file_exists($directory)) { |
|
60 | + if (!file_exists($directory)) { |
|
61 | 61 | mkdir($directory, recursive: true); |
62 | 62 | } |
63 | 63 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | public function getContentLength(): int |
57 | 57 | { |
58 | - if (! is_file($this->getAbsolutePath())) { |
|
58 | + if (!is_file($this->getAbsolutePath())) { |
|
59 | 59 | throw new FileNotFoundException($this->path); |
60 | 60 | } |
61 | 61 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | protected static function discoverMediaAssetFiles(): array |
98 | 98 | { |
99 | - return collect(static::getMediaAssetFiles())->mapWithKeys(function (string $path): array { |
|
99 | + return collect(static::getMediaAssetFiles())->mapWithKeys(function(string $path): array { |
|
100 | 100 | $file = static::make($path); |
101 | 101 | |
102 | 102 | return [$file->getIdentifier() => $file]; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | // Scan the source directory, and directories therein, for files that match the model's file extension. |
57 | 57 | foreach (glob($this->kernel->path($pageClass::sourcePath('{*,**/*}')), GLOB_BRACE) as $path) { |
58 | - if (! str_starts_with(basename((string) $path), '_')) { |
|
58 | + if (!str_starts_with(basename((string) $path), '_')) { |
|
59 | 59 | $this->addFile(SourceFile::make($path, $pageClass)); |
60 | 60 | } |
61 | 61 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function getFiles(?string $pageClass = null): FileCollection |
74 | 74 | { |
75 | - return $pageClass ? $this->filter(function (SourceFile $file) use ($pageClass): bool { |
|
75 | + return $pageClass ? $this->filter(function(SourceFile $file) use ($pageClass) : bool { |
|
76 | 76 | return $file->pageClass === $pageClass; |
77 | 77 | }) : $this; |
78 | 78 | } |
@@ -48,8 +48,8 @@ |
||
48 | 48 | |
49 | 49 | protected function run(): void |
50 | 50 | { |
51 | - DocumentationPage::all()->each(function (DocumentationPage $page): void { |
|
52 | - if (! in_array($page->identifier, Config::getArray('docs.exclude_from_search', []))) { |
|
51 | + DocumentationPage::all()->each(function(DocumentationPage $page): void { |
|
52 | + if (!in_array($page->identifier, Config::getArray('docs.exclude_from_search', []))) { |
|
53 | 53 | $this->index->push($this->generatePageEntry($page)); |
54 | 54 | } |
55 | 55 | }); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | public function compileStaticPages(): void |
45 | 45 | { |
46 | - collect($this->getPageTypes())->each(function (string $pageClass): void { |
|
46 | + collect($this->getPageTypes())->each(function(string $pageClass): void { |
|
47 | 47 | $this->compilePagesForClass($pageClass); |
48 | 48 | }); |
49 | 49 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->needsDirectory(Hyde::siteMediaPath()); |
54 | 54 | |
55 | 55 | $this->comment('Transferring Media Assets...'); |
56 | - $this->withProgressBar(MediaFile::files(), function (string $identifier): void { |
|
56 | + $this->withProgressBar(MediaFile::files(), function(string $identifier): void { |
|
57 | 57 | $sitePath = Hyde::siteMediaPath($identifier); |
58 | 58 | $this->needsParentDirectory($sitePath); |
59 | 59 | copy(Hyde::mediaPath($identifier), $sitePath); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $collection = Routes::getRoutes($pageClass); |
73 | 73 | |
74 | - $this->withProgressBar($collection, function (Route $route): void { |
|
74 | + $this->withProgressBar($collection, function(Route $route): void { |
|
75 | 75 | StaticPageBuilder::handle($route->getPage()); |
76 | 76 | }); |
77 | 77 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | /** @return array<class-string<\Hyde\Pages\Concerns\HydePage>> */ |
87 | 87 | protected function getPageTypes(): array |
88 | 88 | { |
89 | - return Hyde::pages()->map(function (HydePage $page): string { |
|
89 | + return Hyde::pages()->map(function(HydePage $page): string { |
|
90 | 90 | return $page::class; |
91 | 91 | })->unique()->values()->toArray(); |
92 | 92 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | public static function enabled(): bool |
50 | 50 | { |
51 | - return Config::getBool('docs.create_search_page', true) && ! Hyde::routes()->has(self::routeKey()); |
|
51 | + return Config::getBool('docs.create_search_page', true) && !Hyde::routes()->has(self::routeKey()); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public static function routeKey(): string |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | /** @return array<string, DropdownNavItem> */ |
32 | 32 | public function getDropdowns(): array |
33 | 33 | { |
34 | - if (! $this->dropdownsEnabled()) { |
|
34 | + if (!$this->dropdownsEnabled()) { |
|
35 | 35 | throw new BadMethodCallException('Dropdowns are not enabled. Enable it by setting `hyde.navigation.subdirectories` to `dropdown`.'); |
36 | 36 | } |
37 | 37 | |
38 | - return $this->items->filter(function (NavItem $item): bool { |
|
38 | + return $this->items->filter(function(NavItem $item): bool { |
|
39 | 39 | return $item instanceof DropdownNavItem; |
40 | 40 | })->values()->all(); |
41 | 41 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | protected function canAddRoute(Route $route): bool |
64 | 64 | { |
65 | - return parent::canAddRoute($route) && (! $route->getPage() instanceof DocumentationPage || $route->is(DocumentationPage::homeRouteName())); |
|
65 | + return parent::canAddRoute($route) && (!$route->getPage() instanceof DocumentationPage || $route->is(DocumentationPage::homeRouteName())); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function canAddItemToDropdown(NavItem $item): bool |