@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | ]); |
| 70 | 70 | |
| 71 | 71 | $parsedRoute = [ |
| 72 | - 'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))), |
|
| 72 | + 'id' => md5($this->getUri($route) . ':' . implode($this->getMethods($route))), |
|
| 73 | 73 | 'group' => $routeGroup, |
| 74 | 74 | 'title' => $docBlock['short'], |
| 75 | 75 | 'description' => $docBlock['long'], |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | 'queryParameters' => $queryParameters, |
| 82 | 82 | 'authenticated' => $this->getAuthStatusFromDocBlock($docBlock['tags']), |
| 83 | 83 | 'response' => $content, |
| 84 | - 'showresponse' => ! empty($content), |
|
| 84 | + 'showresponse' => !empty($content), |
|
| 85 | 85 | ]; |
| 86 | 86 | $parsedRoute['headers'] = $rulesToApply['headers'] ?? []; |
| 87 | 87 | |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | protected function getBodyParametersFromDocBlock(array $tags) |
| 128 | 128 | { |
| 129 | 129 | $parameters = collect($tags) |
| 130 | - ->filter(function ($tag) { |
|
| 130 | + ->filter(function($tag) { |
|
| 131 | 131 | return $tag instanceof Tag && $tag->getName() === 'bodyParam'; |
| 132 | 132 | }) |
| 133 | - ->mapWithKeys(function ($tag) { |
|
| 133 | + ->mapWithKeys(function($tag) { |
|
| 134 | 134 | preg_match('/(.+?)\s+(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content); |
| 135 | 135 | if (empty($content)) { |
| 136 | 136 | // this means only name and type were supplied |
@@ -165,10 +165,10 @@ discard block |
||
| 165 | 165 | protected function getQueryParametersFromDocBlock(array $tags) |
| 166 | 166 | { |
| 167 | 167 | $parameters = collect($tags) |
| 168 | - ->filter(function ($tag) { |
|
| 168 | + ->filter(function($tag) { |
|
| 169 | 169 | return $tag instanceof Tag && $tag->getName() === 'queryParam'; |
| 170 | 170 | }) |
| 171 | - ->mapWithKeys(function ($tag) { |
|
| 171 | + ->mapWithKeys(function($tag) { |
|
| 172 | 172 | preg_match('/(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content); |
| 173 | 173 | if (empty($content)) { |
| 174 | 174 | // this means only name was supplied |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | protected function getAuthStatusFromDocBlock(array $tags) |
| 207 | 207 | { |
| 208 | 208 | $authTag = collect($tags) |
| 209 | - ->first(function ($tag) { |
|
| 209 | + ->first(function($tag) { |
|
| 210 | 210 | return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated'; |
| 211 | 211 | }); |
| 212 | 212 | |
@@ -280,25 +280,25 @@ discard block |
||
| 280 | 280 | $faker->seed($this->fakerSeed); |
| 281 | 281 | } |
| 282 | 282 | $fakeFactories = [ |
| 283 | - 'integer' => function () use ($faker) { |
|
| 283 | + 'integer' => function() use ($faker) { |
|
| 284 | 284 | return $faker->numberBetween(1, 20); |
| 285 | 285 | }, |
| 286 | - 'number' => function () use ($faker) { |
|
| 286 | + 'number' => function() use ($faker) { |
|
| 287 | 287 | return $faker->randomFloat(); |
| 288 | 288 | }, |
| 289 | - 'float' => function () use ($faker) { |
|
| 289 | + 'float' => function() use ($faker) { |
|
| 290 | 290 | return $faker->randomFloat(); |
| 291 | 291 | }, |
| 292 | - 'boolean' => function () use ($faker) { |
|
| 292 | + 'boolean' => function() use ($faker) { |
|
| 293 | 293 | return $faker->boolean(); |
| 294 | 294 | }, |
| 295 | - 'string' => function () use ($faker) { |
|
| 295 | + 'string' => function() use ($faker) { |
|
| 296 | 296 | return $faker->word; |
| 297 | 297 | }, |
| 298 | - 'array' => function () { |
|
| 298 | + 'array' => function() { |
|
| 299 | 299 | return []; |
| 300 | 300 | }, |
| 301 | - 'object' => function () { |
|
| 301 | + 'object' => function() { |
|
| 302 | 302 | return new \stdClass; |
| 303 | 303 | }, |
| 304 | 304 | ]; |