@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | */ |
56 | 56 | protected function getDocblockResponse($tags) |
57 | 57 | { |
58 | - $responseTags = array_filter($tags, function ($tag) { |
|
59 | - if (! ($tag instanceof Tag)) { |
|
58 | + $responseTags = array_filter($tags, function($tag) { |
|
59 | + if (!($tag instanceof Tag)) { |
|
60 | 60 | return false; |
61 | 61 | } |
62 | 62 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $methods = $this->getMethods($route); |
112 | 112 | |
113 | 113 | // Split headers into key - value pairs |
114 | - $headers = collect($headers)->map(function ($value) { |
|
114 | + $headers = collect($headers)->map(function($value) { |
|
115 | 115 | $split = explode(':', $value); |
116 | 116 | |
117 | 117 | return [trim($split[0]) => trim($split[1])]; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | $uri = $this->getUri($route); |
135 | 135 | foreach ($bindings as $model => $id) { |
136 | - $uri = str_replace('{'.$model.'}', $id, $uri); |
|
136 | + $uri = str_replace('{' . $model . '}', $id, $uri); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $uri; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | foreach ($reflectionMethod->getParameters() as $parameter) { |
198 | 198 | $parameterType = $parameter->getClass(); |
199 | - if (! is_null($parameterType) && class_exists($parameterType->name)) { |
|
199 | + if (!is_null($parameterType) && class_exists($parameterType->name)) { |
|
200 | 200 | $className = $parameterType->name; |
201 | 201 | |
202 | 202 | if (is_subclass_of($className, FormRequest::class)) { |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | */ |
227 | 227 | protected function fancyImplode($arr, $first, $last) |
228 | 228 | { |
229 | - $arr = array_map(function ($value) { |
|
230 | - return '`'.$value.'`'; |
|
229 | + $arr = array_map(function($value) { |
|
230 | + return '`' . $value . '`'; |
|
231 | 231 | }, $arr); |
232 | 232 | array_push($arr, implode($last, array_splice($arr, -2))); |
233 | 233 | |
@@ -237,8 +237,8 @@ discard block |
||
237 | 237 | protected function splitValuePairs($parameters, $first = 'is ', $last = 'or ') |
238 | 238 | { |
239 | 239 | $attribute = ''; |
240 | - collect($parameters)->map(function ($item, $key) use (&$attribute, $first, $last) { |
|
241 | - $attribute .= '`'.$item.'` '; |
|
240 | + collect($parameters)->map(function($item, $key) use (&$attribute, $first, $last) { |
|
241 | + $attribute .= '`' . $item . '` '; |
|
242 | 242 | if (($key + 1) % 2 === 0) { |
243 | 243 | $attribute .= $last; |
244 | 244 | } else { |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | } |
313 | 313 | break; |
314 | 314 | case 'between': |
315 | - if (! isset($attributeData['type'])) { |
|
315 | + if (!isset($attributeData['type'])) { |
|
316 | 316 | $attributeData['type'] = 'numeric'; |
317 | 317 | } |
318 | 318 | $attributeData['description'][] = Description::parse($rule)->with($parameters)->getDescription(); |
@@ -474,8 +474,8 @@ discard block |
||
474 | 474 | foreach ($headers as $name => $value) { |
475 | 475 | $name = strtr(strtoupper($name), '-', '_'); |
476 | 476 | |
477 | - if (! Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
478 | - $name = $prefix.$name; |
|
477 | + if (!Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
478 | + $name = $prefix . $name; |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | $server[$name] = $value; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $response = $docblockResponse; |
68 | 68 | $showresponse = true; |
69 | 69 | } |
70 | - if (! $response) { |
|
70 | + if (!$response) { |
|
71 | 71 | $transformerResponse = $this->getTransformerResponse($routeDescription['tags']); |
72 | 72 | if ($transformerResponse) { |
73 | 73 | // we have a transformer response from the docblock ( @transformer || @transformercollection ) |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $showresponse = true; |
76 | 76 | } |
77 | 77 | } |
78 | - if (! $response) { |
|
78 | + if (!$response) { |
|
79 | 79 | $response = $this->getRouteResponse($route, $bindings, $headers); |
80 | 80 | } |
81 | 81 | if ($response->headers->get('Content-Type') === 'application/json') { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | return $this->getParameters([ |
89 | - 'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))), |
|
89 | + 'id' => md5($this->getUri($route) . ':' . implode($this->getMethods($route))), |
|
90 | 90 | 'resource' => $routeGroup, |
91 | 91 | 'title' => $routeDescription['short'], |
92 | 92 | 'description' => $routeDescription['long'], |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | $kernel->terminate($request, $response); |
142 | 142 | |
143 | - if (file_exists($file = App::bootstrapPath().'/app.php')) { |
|
143 | + if (file_exists($file = App::bootstrapPath() . '/app.php')) { |
|
144 | 144 | $app = require $file; |
145 | 145 | $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap(); |
146 | 146 | } |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | protected function getTransformerResponse($tags) |
159 | 159 | { |
160 | 160 | try { |
161 | - $transFormerTags = array_filter($tags, function ($tag) { |
|
162 | - if (! ($tag instanceof Tag)) { |
|
161 | + $transFormerTags = array_filter($tags, function($tag) { |
|
162 | + if (!($tag instanceof Tag)) { |
|
163 | 163 | return false; |
164 | 164 | } |
165 | 165 | |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | return false; |
171 | 171 | } |
172 | 172 | |
173 | - $modelTag = array_first(array_filter($tags, function ($tag) { |
|
174 | - if (! ($tag instanceof Tag)) { |
|
173 | + $modelTag = array_first(array_filter($tags, function($tag) { |
|
174 | + if (!($tag instanceof Tag)) { |
|
175 | 175 | return false; |
176 | 176 | } |
177 | 177 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | })); |
180 | 180 | $tag = \array_first($transFormerTags); |
181 | 181 | $transformer = $tag->getContent(); |
182 | - if (! \class_exists($transformer)) { |
|
182 | + if (!\class_exists($transformer)) { |
|
183 | 183 | // if we can't find the transformer we can't generate a response |
184 | 184 | return; |
185 | 185 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | if (version_compare(PHP_VERSION, '7.0.0') >= 0 && \is_null($type)) { |
196 | 196 | // we can only get the type with reflection for PHP 7 |
197 | 197 | if ($parameter->hasType() && |
198 | - ! $parameter->getType()->isBuiltin() && |
|
198 | + !$parameter->getType()->isBuiltin() && |
|
199 | 199 | \class_exists((string) $parameter->getType())) { |
200 | 200 | //we have a type |
201 | 201 | $type = (string) $parameter->getType(); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | foreach ($reflectionMethod->getParameters() as $parameter) { |
257 | 257 | $parameterType = $parameter->getClass(); |
258 | - if (! is_null($parameterType) && class_exists($parameterType->name)) { |
|
258 | + if (!is_null($parameterType) && class_exists($parameterType->name)) { |
|
259 | 259 | $className = $parameterType->name; |
260 | 260 | |
261 | 261 | if (is_subclass_of($className, FormRequest::class)) { |