@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | $this->displaySelections($creator); |
38 | 38 | |
39 | - if (! $this->confirm('Do you wish to continue?', true)) { |
|
39 | + if (!$this->confirm('Do you wish to continue?', true)) { |
|
40 | 40 | $this->info('Aborting.'); |
41 | 41 | |
42 | 42 | return Command::USER_EXIT; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function mediaLink(string $destination, bool $validate = false): string |
91 | 91 | { |
92 | - if ($validate && ! file_exists($sourcePath = "{$this->kernel->getMediaDirectory()}/$destination")) { |
|
92 | + if ($validate && !file_exists($sourcePath = "{$this->kernel->getMediaDirectory()}/$destination")) { |
|
93 | 93 | throw new FileNotFoundException($sourcePath); |
94 | 94 | } |
95 | 95 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function hasSiteUrl(): bool |
125 | 125 | { |
126 | - return ! blank(Config::getNullableString('hyde.url')); |
|
126 | + return !blank(Config::getNullableString('hyde.url')); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | public function addExtension(string $extensionClassName): void |
89 | 89 | { |
90 | - if (! in_array($extensionClassName, $this->extensions)) { |
|
90 | + if (!in_array($extensionClassName, $this->extensions)) { |
|
91 | 91 | $this->extensions[] = $extensionClassName; |
92 | 92 | } |
93 | 93 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | public function addFeature(string $feature): static |
130 | 130 | { |
131 | - if (! in_array($feature, $this->features)) { |
|
131 | + if (!in_array($feature, $this->features)) { |
|
132 | 132 | $this->features[] = $feature; |
133 | 133 | } |
134 | 134 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | protected function determineIfTorchlightAttributionShouldBeInjected(): bool |
182 | 182 | { |
183 | - return ! $this->isDocumentationPage() |
|
183 | + return !$this->isDocumentationPage() |
|
184 | 184 | && Config::getBool('torchlight.attribution.enabled', true) |
185 | 185 | && str_contains($this->html, 'Syntax highlighted by torchlight.dev'); |
186 | 186 | } |
@@ -93,11 +93,11 @@ |
||
93 | 93 | Hyde::pathToRelative(DocumentationPage::path()), |
94 | 94 | ]; |
95 | 95 | |
96 | - if (! in_array($directory, $directories)) { |
|
96 | + if (!in_array($directory, $directories)) { |
|
97 | 97 | throw new Exception("Path [$this->path] is not in a valid source directory.", 400); |
98 | 98 | } |
99 | 99 | |
100 | - if (! file_exists(Hyde::path($this->path))) { |
|
100 | + if (!file_exists(Hyde::path($this->path))) { |
|
101 | 101 | throw new Exception("File [$this->path] not found.", 404); |
102 | 102 | } |
103 | 103 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | protected function runDiscovery(): void |
34 | 34 | { |
35 | - $this->kernel->files()->each(function (SourceFile $file): void { |
|
35 | + $this->kernel->files()->each(function(SourceFile $file): void { |
|
36 | 36 | $this->addPage($this->parsePage($file->pageClass, $file->getPath())); |
37 | 37 | }); |
38 | 38 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function getPages(?string $pageClass = null): PageCollection |
64 | 64 | { |
65 | - return $pageClass ? $this->filter(function (HydePage $page) use ($pageClass): bool { |
|
65 | + return $pageClass ? $this->filter(function(HydePage $page) use ($pageClass) : bool { |
|
66 | 66 | return $page instanceof $pageClass; |
67 | 67 | }) : $this; |
68 | 68 | } |
@@ -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 | } |
@@ -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 | } |