@@ -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; |