@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | $generatedDocumentation = file_get_contents($targetFile); |
115 | 115 | $compareDocumentation = file_get_contents($compareFile); |
116 | 116 | |
117 | - $parsedRouteOutput->transform(function (Collection $routeGroup) use ($generatedDocumentation, $compareDocumentation) { |
|
118 | - return $routeGroup->transform(function (array $route) use ($generatedDocumentation, $compareDocumentation) { |
|
117 | + $parsedRouteOutput->transform(function(Collection $routeGroup) use ($generatedDocumentation, $compareDocumentation) { |
|
118 | + return $routeGroup->transform(function(array $route) use ($generatedDocumentation, $compareDocumentation) { |
|
119 | 119 | if (preg_match('/<!-- START_' . $route['id'] . ' -->(.*)<!-- END_' . $route['id'] . ' -->/is', $generatedDocumentation, $existingRouteDoc)) { |
120 | 120 | $routeDocumentationChanged = (preg_match('/<!-- START_' . $route['id'] . ' -->(.*)<!-- END_' . $route['id'] . ' -->/is', $compareDocumentation, $lastDocWeGeneratedForThisRoute) && $lastDocWeGeneratedForThisRoute[1] !== $existingRouteDoc[1]); |
121 | 121 | if ($routeDocumentationChanged === false || $this->forceIt) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | $this->output->info('Writing index.md and source files to: ' . $this->sourceOutputPath); |
150 | 150 | |
151 | - if (! is_dir($this->sourceOutputPath)) { |
|
151 | + if (!is_dir($this->sourceOutputPath)) { |
|
152 | 152 | $documentarian = new Documentarian(); |
153 | 153 | $documentarian->create($this->sourceOutputPath); |
154 | 154 | } |
@@ -174,14 +174,14 @@ discard block |
||
174 | 174 | |
175 | 175 | public function generateMarkdownOutputForEachRoute(Collection $parsedRoutes, array $settings): Collection |
176 | 176 | { |
177 | - $parsedRouteOutput = $parsedRoutes->map(function (Collection $routeGroup) use ($settings) { |
|
178 | - return $routeGroup->map(function (array $route) use ($settings) { |
|
179 | - if (count($route['cleanBodyParameters']) && ! isset($route['headers']['Content-Type'])) { |
|
177 | + $parsedRouteOutput = $parsedRoutes->map(function(Collection $routeGroup) use ($settings) { |
|
178 | + return $routeGroup->map(function(array $route) use ($settings) { |
|
179 | + if (count($route['cleanBodyParameters']) && !isset($route['headers']['Content-Type'])) { |
|
180 | 180 | // Set content type if the user forgot to set it |
181 | 181 | $route['headers']['Content-Type'] = 'application/json'; |
182 | 182 | } |
183 | 183 | |
184 | - $hasRequestOptions = ! empty($route['headers']) || ! empty($route['cleanQueryParameters']) || ! empty($route['cleanBodyParameters']); |
|
184 | + $hasRequestOptions = !empty($route['headers']) || !empty($route['cleanQueryParameters']) || !empty($route['cleanBodyParameters']); |
|
185 | 185 | $route['output'] = (string) view('apidoc::partials.route') |
186 | 186 | ->with('hasRequestOptions', $hasRequestOptions) |
187 | 187 | ->with('route', $route) |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | protected function copyAssetsFromSourceFolderToPublicFolder(): void |
254 | 254 | { |
255 | 255 | $publicPath = $this->config->get('output_folder') ?? 'public/docs'; |
256 | - if (! is_dir($publicPath)) { |
|
256 | + if (!is_dir($publicPath)) { |
|
257 | 257 | mkdir($publicPath, 0777, true); |
258 | 258 | mkdir("{$publicPath}/css"); |
259 | 259 | mkdir("{$publicPath}/js"); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | rename("{$this->sourceOutputPath}/index.html", "{$this->outputPath}/index.html"); |
275 | 275 | } else { |
276 | 276 | // Move output to resources/views |
277 | - if (! is_dir($this->outputPath)) { |
|
277 | + if (!is_dir($this->outputPath)) { |
|
278 | 278 | mkdir($this->outputPath); |
279 | 279 | } |
280 | 280 | rename("{$this->sourceOutputPath}/index.html", "$this->outputPath/index.blade.php"); |