@@ -34,8 +34,7 @@ discard block |
||
| 34 | 34 | public function with($parameters) |
| 35 | 35 | { |
| 36 | 36 | is_array($parameters) ? |
| 37 | - $this->parameters += $parameters : |
|
| 38 | - $this->parameters[] = $parameters; |
|
| 37 | + $this->parameters += $parameters : $this->parameters[] = $parameters; |
|
| 39 | 38 | |
| 40 | 39 | return $this; |
| 41 | 40 | } |
@@ -54,8 +53,7 @@ discard block |
||
| 54 | 53 | protected function makeDescription() |
| 55 | 54 | { |
| 56 | 55 | $description = trans()->hasForLocale($this->rule) ? |
| 57 | - trans()->get($this->rule) : |
|
| 58 | - trans()->get($this->rule, [], self::DEFAULT_LOCALE); |
|
| 56 | + trans()->get($this->rule) : trans()->get($this->rule, [], self::DEFAULT_LOCALE); |
|
| 59 | 57 | |
| 60 | 58 | return $this->replaceAttributes($description); |
| 61 | 59 | } |
@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public function boot() |
| 17 | 17 | { |
| 18 | - $this->loadViewsFrom(__DIR__.'/../../resources/views/', 'apidoc'); |
|
| 19 | - $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'apidoc'); |
|
| 18 | + $this->loadViewsFrom(__DIR__ . '/../../resources/views/', 'apidoc'); |
|
| 19 | + $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'apidoc'); |
|
| 20 | 20 | |
| 21 | 21 | $this->publishes([ |
| 22 | - __DIR__.'/../../resources/lang' => $this->resource_path('lang/vendor/apidoc'), |
|
| 23 | - __DIR__.'/../../resources/views' => $this->resource_path('views/vendor/apidoc'), |
|
| 22 | + __DIR__ . '/../../resources/lang' => $this->resource_path('lang/vendor/apidoc'), |
|
| 23 | + __DIR__ . '/../../resources/views' => $this->resource_path('views/vendor/apidoc'), |
|
| 24 | 24 | ]); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function register() |
| 33 | 33 | { |
| 34 | - $this->app->singleton('apidoc.generate', function () { |
|
| 34 | + $this->app->singleton('apidoc.generate', function() { |
|
| 35 | 35 | return new GenerateDocumentation(); |
| 36 | 36 | }); |
| 37 | - $this->app->singleton('apidoc.update', function () { |
|
| 37 | + $this->app->singleton('apidoc.update', function() { |
|
| 38 | 38 | return new UpdateDocumentation(); |
| 39 | 39 | }); |
| 40 | 40 | |
@@ -53,6 +53,6 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function resource_path($path = '') |
| 55 | 55 | { |
| 56 | - return app()->basePath().'/resources'.($path ? '/'.$path : $path); |
|
| 56 | + return app()->basePath() . '/resources' . ($path ? '/' . $path : $path); |
|
| 57 | 57 | } |
| 58 | 58 | } |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | 'description' => '', |
| 33 | 33 | 'schema' => 'https://schema.getpostman.com/json/collection/v2.0.0/collection.json', |
| 34 | 34 | ], |
| 35 | - 'item' => $this->routeGroups->map(function ($routes, $groupName) { |
|
| 35 | + 'item' => $this->routeGroups->map(function($routes, $groupName) { |
|
| 36 | 36 | return [ |
| 37 | 37 | 'name' => $groupName, |
| 38 | 38 | 'description' => '', |
| 39 | - 'item' => $routes->map(function ($route) { |
|
| 39 | + 'item' => $routes->map(function($route) { |
|
| 40 | 40 | return [ |
| 41 | 41 | 'name' => $route['title'] != '' ? $route['title'] : url($route['uri']), |
| 42 | 42 | 'request' => [ |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | 'method' => $route['methods'][0], |
| 45 | 45 | 'body' => [ |
| 46 | 46 | 'mode' => 'formdata', |
| 47 | - 'formdata' => collect($route['parameters'])->map(function ($parameter, $key) { |
|
| 47 | + 'formdata' => collect($route['parameters'])->map(function($parameter, $key) { |
|
| 48 | 48 | return [ |
| 49 | 49 | 'key' => $key, |
| 50 | 50 | 'value' => isset($parameter['value']) ? $parameter['value'] : '', |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | $this->setUserToBeImpersonated($this->option('actAsUserId')); |
| 77 | 77 | |
| 78 | - if ($routePrefix === null && $routeDomain === null && ! count($allowedRoutes) && $middleware === null) { |
|
| 78 | + if ($routePrefix === null && $routeDomain === null && !count($allowedRoutes) && $middleware === null) { |
|
| 79 | 79 | $this->error('You must provide either a route prefix, a route domain, a route or a middleware to generate the documentation.'); |
| 80 | 80 | |
| 81 | 81 | return false; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | - $parsedRoutes = collect($parsedRoutes)->groupBy('resource')->sort(function ($a, $b) { |
|
| 104 | + $parsedRoutes = collect($parsedRoutes)->groupBy('resource')->sort(function($a, $b) { |
|
| 105 | 105 | return strcmp($a->first()['resource'], $b->first()['resource']); |
| 106 | 106 | }); |
| 107 | 107 | |
@@ -116,15 +116,15 @@ discard block |
||
| 116 | 116 | private function writeMarkdown($parsedRoutes) |
| 117 | 117 | { |
| 118 | 118 | $outputPath = $this->option('output'); |
| 119 | - $targetFile = $outputPath.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'index.md'; |
|
| 120 | - $compareFile = $outputPath.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'.compare.md'; |
|
| 119 | + $targetFile = $outputPath . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . 'index.md'; |
|
| 120 | + $compareFile = $outputPath . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . '.compare.md'; |
|
| 121 | 121 | |
| 122 | 122 | $infoText = view('apidoc::partials.info') |
| 123 | 123 | ->with('outputPath', ltrim($outputPath, 'public/')) |
| 124 | - ->with('showPostmanCollectionButton', ! $this->option('noPostmanCollection')); |
|
| 124 | + ->with('showPostmanCollectionButton', !$this->option('noPostmanCollection')); |
|
| 125 | 125 | |
| 126 | - $parsedRouteOutput = $parsedRoutes->map(function ($routeGroup) { |
|
| 127 | - return $routeGroup->map(function ($route) { |
|
| 126 | + $parsedRouteOutput = $parsedRoutes->map(function($routeGroup) { |
|
| 127 | + return $routeGroup->map(function($route) { |
|
| 128 | 128 | $route['output'] = (string) view('apidoc::partials.route')->with('parsedRoute', $route)->render(); |
| 129 | 129 | |
| 130 | 130 | return $route; |
@@ -144,16 +144,16 @@ discard block |
||
| 144 | 144 | $frontmatter = trim($generatedFrontmatter[1], "\n"); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $parsedRouteOutput->transform(function ($routeGroup) use ($generatedDocumentation, $compareDocumentation) { |
|
| 148 | - return $routeGroup->transform(function ($route) use ($generatedDocumentation, $compareDocumentation) { |
|
| 149 | - if (preg_match('/<!-- START_'.$route['id'].' -->(.*)<!-- END_'.$route['id'].' -->/is', $generatedDocumentation, $routeMatch)) { |
|
| 150 | - $routeDocumentationChanged = (preg_match('/<!-- START_'.$route['id'].' -->(.*)<!-- END_'.$route['id'].' -->/is', $compareDocumentation, $compareMatch) && $compareMatch[1] !== $routeMatch[1]); |
|
| 147 | + $parsedRouteOutput->transform(function($routeGroup) use ($generatedDocumentation, $compareDocumentation) { |
|
| 148 | + return $routeGroup->transform(function($route) use ($generatedDocumentation, $compareDocumentation) { |
|
| 149 | + if (preg_match('/<!-- START_' . $route['id'] . ' -->(.*)<!-- END_' . $route['id'] . ' -->/is', $generatedDocumentation, $routeMatch)) { |
|
| 150 | + $routeDocumentationChanged = (preg_match('/<!-- START_' . $route['id'] . ' -->(.*)<!-- END_' . $route['id'] . ' -->/is', $compareDocumentation, $compareMatch) && $compareMatch[1] !== $routeMatch[1]); |
|
| 151 | 151 | if ($routeDocumentationChanged === false || $this->option('force')) { |
| 152 | 152 | if ($routeDocumentationChanged) { |
| 153 | - $this->warn('Discarded manual changes for route ['.implode(',', $route['methods']).'] '.$route['uri']); |
|
| 153 | + $this->warn('Discarded manual changes for route [' . implode(',', $route['methods']) . '] ' . $route['uri']); |
|
| 154 | 154 | } |
| 155 | 155 | } else { |
| 156 | - $this->warn('Skipping modified route ['.implode(',', $route['methods']).'] '.$route['uri']); |
|
| 156 | + $this->warn('Skipping modified route [' . implode(',', $route['methods']) . '] ' . $route['uri']); |
|
| 157 | 157 | $route['modified_output'] = $routeMatch[0]; |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -170,10 +170,10 @@ discard block |
||
| 170 | 170 | ->with('frontmatter', $frontmatter) |
| 171 | 171 | ->with('infoText', $infoText) |
| 172 | 172 | ->with('outputPath', $this->option('output')) |
| 173 | - ->with('showPostmanCollectionButton', ! $this->option('noPostmanCollection')) |
|
| 173 | + ->with('showPostmanCollectionButton', !$this->option('noPostmanCollection')) |
|
| 174 | 174 | ->with('parsedRoutes', $parsedRouteOutput); |
| 175 | 175 | |
| 176 | - if (! is_dir($outputPath)) { |
|
| 176 | + if (!is_dir($outputPath)) { |
|
| 177 | 177 | $documentarian->create($outputPath); |
| 178 | 178 | } |
| 179 | 179 | |
@@ -186,23 +186,23 @@ discard block |
||
| 186 | 186 | ->with('frontmatter', $frontmatter) |
| 187 | 187 | ->with('infoText', $infoText) |
| 188 | 188 | ->with('outputPath', $this->option('output')) |
| 189 | - ->with('showPostmanCollectionButton', ! $this->option('noPostmanCollection')) |
|
| 189 | + ->with('showPostmanCollectionButton', !$this->option('noPostmanCollection')) |
|
| 190 | 190 | ->with('parsedRoutes', $parsedRouteOutput); |
| 191 | 191 | |
| 192 | 192 | file_put_contents($compareFile, $compareMarkdown); |
| 193 | 193 | |
| 194 | - $this->info('Wrote index.md to: '.$outputPath); |
|
| 194 | + $this->info('Wrote index.md to: ' . $outputPath); |
|
| 195 | 195 | |
| 196 | 196 | $this->info('Generating API HTML code'); |
| 197 | 197 | |
| 198 | 198 | $documentarian->generate($outputPath); |
| 199 | 199 | |
| 200 | - $this->info('Wrote HTML documentation to: '.$outputPath.'/index.html'); |
|
| 200 | + $this->info('Wrote HTML documentation to: ' . $outputPath . '/index.html'); |
|
| 201 | 201 | |
| 202 | 202 | if ($this->option('noPostmanCollection') !== true) { |
| 203 | 203 | $this->info('Generating Postman collection'); |
| 204 | 204 | |
| 205 | - file_put_contents($outputPath.DIRECTORY_SEPARATOR.'collection.json', $this->generatePostmanCollection($parsedRoutes)); |
|
| 205 | + file_put_contents($outputPath . DIRECTORY_SEPARATOR . 'collection.json', $this->generatePostmanCollection($parsedRoutes)); |
|
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | private function setUserToBeImpersonated($actAs) |
| 232 | 232 | { |
| 233 | - if (! empty($actAs)) { |
|
| 233 | + if (!empty($actAs)) { |
|
| 234 | 234 | if (version_compare($this->laravel->version(), '5.2.0', '<')) { |
| 235 | 235 | $userModel = config('auth.model'); |
| 236 | 236 | $user = $userModel::find($actAs); |
@@ -278,9 +278,9 @@ discard block |
||
| 278 | 278 | ) { |
| 279 | 279 | if ($this->isValidRoute($route) && $this->isRouteVisibleForDocumentation($route->getAction()['uses'])) { |
| 280 | 280 | $parsedRoutes[] = $generator->processRoute($route, $bindings, $this->option('header'), $withResponse && in_array('GET', $generator->getMethods($route))); |
| 281 | - $this->info('Processed route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route)); |
|
| 281 | + $this->info('Processed route: [' . implode(',', $generator->getMethods($route)) . '] ' . $generator->getUri($route)); |
|
| 282 | 282 | } else { |
| 283 | - $this->warn('Skipping route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route)); |
|
| 283 | + $this->warn('Skipping route: [' . implode(',', $generator->getMethods($route)) . '] ' . $generator->getUri($route)); |
|
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | } |
@@ -312,9 +312,9 @@ discard block |
||
| 312 | 312 | ) { |
| 313 | 313 | if ($this->isValidRoute($route) && $this->isRouteVisibleForDocumentation($route->getAction()['uses'])) { |
| 314 | 314 | $parsedRoutes[] = $generator->processRoute($route, $bindings, $this->option('header'), $withResponse && in_array('GET', $generator->getMethods($route))); |
| 315 | - $this->info('Processed route: ['.implode(',', $generator->getMethods($route)).'] '.$route->uri()); |
|
| 315 | + $this->info('Processed route: [' . implode(',', $generator->getMethods($route)) . '] ' . $route->uri()); |
|
| 316 | 316 | } else { |
| 317 | - $this->warn('Skipping route: ['.implode(',', $generator->getMethods($route)).'] '.$route->uri()); |
|
| 317 | + $this->warn('Skipping route: [' . implode(',', $generator->getMethods($route)) . '] ' . $route->uri()); |
|
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | private function isValidRoute($route) |
| 331 | 331 | { |
| 332 | - return ! is_callable($route->getAction()['uses']) && ! is_null($route->getAction()['uses']); |
|
| 332 | + return !is_callable($route->getAction()['uses']) && !is_null($route->getAction()['uses']); |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /** |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | $phpdoc = new DocBlock($comment); |
| 347 | 347 | |
| 348 | 348 | return collect($phpdoc->getTags()) |
| 349 | - ->filter(function ($tag) use ($route) { |
|
| 349 | + ->filter(function($tag) use ($route) { |
|
| 350 | 350 | return $tag->getName() === 'hideFromAPIDocumentation'; |
| 351 | 351 | }) |
| 352 | 352 | ->isEmpty(); |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $documentarian = new Documentarian(); |
| 46 | 46 | |
| 47 | - if (! is_dir($outputPath)) { |
|
| 48 | - $this->error('There is no generated documentation available at '.$outputPath.'.'); |
|
| 47 | + if (!is_dir($outputPath)) { |
|
| 48 | + $this->error('There is no generated documentation available at ' . $outputPath . '.'); |
|
| 49 | 49 | |
| 50 | 50 | return false; |
| 51 | 51 | } |
@@ -53,6 +53,6 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | $documentarian->generate($outputPath); |
| 55 | 55 | |
| 56 | - $this->info('Wrote HTML documentation to: '.$outputPath.'/index.html'); |
|
| 56 | + $this->info('Wrote HTML documentation to: ' . $outputPath . '/index.html'); |
|
| 57 | 57 | } |
| 58 | 58 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function prepareMiddleware($enable = true) |
| 65 | 65 | { |
| 66 | - App::instance('middleware.disable', ! $enable); |
|
| 66 | + App::instance('middleware.disable', !$enable); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | protected function getTransformerResponse($tags) |
| 110 | 110 | { |
| 111 | 111 | try { |
| 112 | - $transFormerTags = array_filter($tags, function ($tag) { |
|
| 113 | - if (! ($tag instanceof Tag)) { |
|
| 112 | + $transFormerTags = array_filter($tags, function($tag) { |
|
| 113 | + if (!($tag instanceof Tag)) { |
|
| 114 | 114 | return false; |
| 115 | 115 | } |
| 116 | 116 | |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | return false; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - $modelTag = array_first(array_filter($tags, function ($tag) { |
|
| 125 | - if (! ($tag instanceof Tag)) { |
|
| 124 | + $modelTag = array_first(array_filter($tags, function($tag) { |
|
| 125 | + if (!($tag instanceof Tag)) { |
|
| 126 | 126 | return false; |
| 127 | 127 | } |
| 128 | 128 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | })); |
| 131 | 131 | $tag = \array_first($transFormerTags); |
| 132 | 132 | $transformer = $tag->getContent(); |
| 133 | - if (! \class_exists($transformer)) { |
|
| 133 | + if (!\class_exists($transformer)) { |
|
| 134 | 134 | // if we can't find the transformer we can't generate a response |
| 135 | 135 | return; |
| 136 | 136 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if (version_compare(PHP_VERSION, '7.0.0') >= 0 && \is_null($type)) { |
| 147 | 147 | // we can only get the type with reflection for PHP 7 |
| 148 | 148 | if ($parameter->hasType() && |
| 149 | - ! $parameter->getType()->isBuiltin() && |
|
| 149 | + !$parameter->getType()->isBuiltin() && |
|
| 150 | 150 | \class_exists((string) $parameter->getType())) { |
| 151 | 151 | //we have a type |
| 152 | 152 | $type = (string) $parameter->getType(); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $dispatcher = app('Dingo\Api\Dispatcher')->raw(); |
| 27 | 27 | |
| 28 | - collect($server)->map(function ($key, $value) use ($dispatcher) { |
|
| 28 | + collect($server)->map(function($key, $value) use ($dispatcher) { |
|
| 29 | 29 | $dispatcher->header($value, $key); |
| 30 | 30 | }); |
| 31 | 31 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $response = $docblockResponse; |
| 63 | 63 | $showresponse = true; |
| 64 | 64 | } |
| 65 | - if (! $response) { |
|
| 65 | + if (!$response) { |
|
| 66 | 66 | $transformerResponse = $this->getTransformerResponse($routeDescription['tags']); |
| 67 | 67 | if ($transformerResponse) { |
| 68 | 68 | // we have a transformer response from the docblock ( @transformer || @transformercollection ) |
@@ -70,17 +70,17 @@ discard block |
||
| 70 | 70 | $showresponse = true; |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | - if (! $response && $withResponse) { |
|
| 73 | + if (!$response && $withResponse) { |
|
| 74 | 74 | try { |
| 75 | 75 | $response = $this->getRouteResponse($route, $bindings, $headers); |
| 76 | 76 | } catch (\Exception $e) { |
| 77 | - dump("Couldn't get response for route: ".implode(',', $this->getMethods($route)).'] '.$route->uri().'', $e); |
|
| 77 | + dump("Couldn't get response for route: " . implode(',', $this->getMethods($route)) . '] ' . $route->uri() . '', $e); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | $content = $this->getResponseContent($response); |
| 82 | 82 | return $this->getParameters([ |
| 83 | - 'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))), |
|
| 83 | + 'id' => md5($this->getUri($route) . ':' . implode($this->getMethods($route))), |
|
| 84 | 84 | 'resource' => $routeGroup, |
| 85 | 85 | 'title' => $routeDescription['short'], |
| 86 | 86 | 'description' => $routeDescription['long'], |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | protected function getDocblockResponse($tags) |
| 112 | 112 | { |
| 113 | - $responseTags = array_filter($tags, function ($tag) { |
|
| 114 | - if (! ($tag instanceof Tag)) { |
|
| 113 | + $responseTags = array_filter($tags, function($tag) { |
|
| 114 | + if (!($tag instanceof Tag)) { |
|
| 115 | 115 | return false; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $values = collect($simplifiedRules) |
| 172 | - ->filter(function ($values) { |
|
| 172 | + ->filter(function($values) { |
|
| 173 | 173 | return in_array('array', $values); |
| 174 | - })->map(function ($val, $key) { |
|
| 174 | + })->map(function($val, $key) { |
|
| 175 | 175 | return ['']; |
| 176 | 176 | })->all(); |
| 177 | 177 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $methods = $this->getMethods($route); |
| 193 | 193 | |
| 194 | 194 | // Split headers into key - value pairs |
| 195 | - $headers = collect($headers)->map(function ($value) { |
|
| 195 | + $headers = collect($headers)->map(function($value) { |
|
| 196 | 196 | $split = explode(':', $value); // explode to get key + values |
| 197 | 197 | $key = array_shift($split); // extract the key and keep the values in the array |
| 198 | 198 | $value = implode(':', $split); // implode values into string again |
@@ -216,8 +216,8 @@ discard block |
||
| 216 | 216 | { |
| 217 | 217 | $uri = $this->getUri($route); |
| 218 | 218 | foreach ($bindings as $model => $id) { |
| 219 | - $uri = str_replace('{'.$model.'}', $id, $uri); |
|
| 220 | - $uri = str_replace('{'.$model.'?}', $id, $uri); |
|
| 219 | + $uri = str_replace('{' . $model . '}', $id, $uri); |
|
| 220 | + $uri = str_replace('{' . $model . '?}', $id, $uri); |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | return $uri; |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | foreach ($reflectionMethod->getParameters() as $parameter) { |
| 283 | 283 | $parameterType = $parameter->getClass(); |
| 284 | - if (! is_null($parameterType) && class_exists($parameterType->name)) { |
|
| 284 | + if (!is_null($parameterType) && class_exists($parameterType->name)) { |
|
| 285 | 285 | $className = $parameterType->name; |
| 286 | 286 | |
| 287 | 287 | if (is_subclass_of($className, FormRequest::class)) { |
@@ -317,8 +317,8 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | protected function fancyImplode($arr, $first, $last) |
| 319 | 319 | { |
| 320 | - $arr = array_map(function ($value) { |
|
| 321 | - return '`'.$value.'`'; |
|
| 320 | + $arr = array_map(function($value) { |
|
| 321 | + return '`' . $value . '`'; |
|
| 322 | 322 | }, $arr); |
| 323 | 323 | array_push($arr, implode($last, array_splice($arr, -2))); |
| 324 | 324 | |
@@ -328,8 +328,8 @@ discard block |
||
| 328 | 328 | protected function splitValuePairs($parameters, $first = 'is ', $last = 'or ') |
| 329 | 329 | { |
| 330 | 330 | $attribute = ''; |
| 331 | - collect($parameters)->map(function ($item, $key) use (&$attribute, $first, $last) { |
|
| 332 | - $attribute .= '`'.$item.'` '; |
|
| 331 | + collect($parameters)->map(function($item, $key) use (&$attribute, $first, $last) { |
|
| 332 | + $attribute .= '`' . $item . '` '; |
|
| 333 | 333 | if (($key + 1) % 2 === 0) { |
| 334 | 334 | $attribute .= $last; |
| 335 | 335 | } else { |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | } |
| 413 | 413 | break; |
| 414 | 414 | case 'between': |
| 415 | - if (! isset($attributeData['type'])) { |
|
| 415 | + if (!isset($attributeData['type'])) { |
|
| 416 | 416 | $attributeData['type'] = 'numeric'; |
| 417 | 417 | } |
| 418 | 418 | $attributeData['description'][] = Description::parse($rule)->with($parameters)->getDescription(); |
@@ -590,8 +590,8 @@ discard block |
||
| 590 | 590 | foreach ($headers as $name => $value) { |
| 591 | 591 | $name = strtr(strtoupper($name), '-', '_'); |
| 592 | 592 | |
| 593 | - if (! Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
| 594 | - $name = $prefix.$name; |
|
| 593 | + if (!Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
| 594 | + $name = $prefix . $name; |
|
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | $server[$name] = $value; |