@@ -14,8 +14,8 @@ |
||
14 | 14 | protected function cleanParams(array $params) |
15 | 15 | { |
16 | 16 | $values = []; |
17 | - $params = array_filter($params, function ($details) { |
|
18 | - return ! is_null($details['value']); |
|
17 | + $params = array_filter($params, function($details) { |
|
18 | + return !is_null($details['value']); |
|
19 | 19 | }); |
20 | 20 | |
21 | 21 | foreach ($params as $name => $details) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ]); |
69 | 69 | |
70 | 70 | $parsedRoute = [ |
71 | - 'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))), |
|
71 | + 'id' => md5($this->getUri($route) . ':' . implode($this->getMethods($route))), |
|
72 | 72 | 'groupName' => $routeGroupName, |
73 | 73 | 'groupDescription' => $routeGroupDescription, |
74 | 74 | 'title' => $routeTitle ?: $docBlock['short'], |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | 'cleanQueryParameters' => $this->cleanParams($queryParameters), |
83 | 83 | 'authenticated' => $this->getAuthStatusFromDocBlock($docBlock['tags']), |
84 | 84 | 'response' => $content, |
85 | - 'showresponse' => ! empty($content), |
|
85 | + 'showresponse' => !empty($content), |
|
86 | 86 | ]; |
87 | 87 | $parsedRoute['headers'] = $rulesToApply['headers'] ?? []; |
88 | 88 | |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | protected function getBodyParametersFromDocBlock(array $tags) |
129 | 129 | { |
130 | 130 | $parameters = collect($tags) |
131 | - ->filter(function ($tag) { |
|
131 | + ->filter(function($tag) { |
|
132 | 132 | return $tag instanceof Tag && $tag->getName() === 'bodyParam'; |
133 | 133 | }) |
134 | - ->mapWithKeys(function ($tag) { |
|
134 | + ->mapWithKeys(function($tag) { |
|
135 | 135 | preg_match('/(.+?)\s+(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content); |
136 | 136 | $content = preg_replace('/\s?No-example.?/', '', $content); |
137 | 137 | if (empty($content)) { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | $type = $this->normalizeParameterType($type); |
153 | 153 | list($description, $example) = $this->parseDescription($description, $type); |
154 | - $value = is_null($example) && ! $this->shouldExcludeExample($tag) ? $this->generateDummyValue($type) : $example; |
|
154 | + $value = is_null($example) && !$this->shouldExcludeExample($tag) ? $this->generateDummyValue($type) : $example; |
|
155 | 155 | |
156 | 156 | return [$name => compact('type', 'description', 'required', 'value')]; |
157 | 157 | })->toArray(); |
@@ -204,10 +204,10 @@ discard block |
||
204 | 204 | protected function getQueryParametersFromDocBlock(array $tags) |
205 | 205 | { |
206 | 206 | $parameters = collect($tags) |
207 | - ->filter(function ($tag) { |
|
207 | + ->filter(function($tag) { |
|
208 | 208 | return $tag instanceof Tag && $tag->getName() === 'queryParam'; |
209 | 209 | }) |
210 | - ->mapWithKeys(function ($tag) { |
|
210 | + ->mapWithKeys(function($tag) { |
|
211 | 211 | preg_match('/(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content); |
212 | 212 | $content = preg_replace('/\s?No-example.?/', '', $content); |
213 | 213 | if (empty($content)) { |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } |
227 | 227 | |
228 | 228 | list($description, $value) = $this->parseDescription($description, 'string'); |
229 | - if (is_null($value) && ! $this->shouldExcludeExample($tag)) { |
|
229 | + if (is_null($value) && !$this->shouldExcludeExample($tag)) { |
|
230 | 230 | $value = str_contains($description, ['number', 'count', 'page']) |
231 | 231 | ? $this->generateDummyValue('integer') |
232 | 232 | : $this->generateDummyValue('string'); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | protected function getAuthStatusFromDocBlock(array $tags) |
247 | 247 | { |
248 | 248 | $authTag = collect($tags) |
249 | - ->first(function ($tag) { |
|
249 | + ->first(function($tag) { |
|
250 | 250 | return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated'; |
251 | 251 | }); |
252 | 252 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | protected function getRouteGroup(ReflectionClass $controller, array $methodDocBlock) |
280 | 280 | { |
281 | 281 | // @group tag on the method overrides that on the controller |
282 | - if (! empty($methodDocBlock['tags'])) { |
|
282 | + if (!empty($methodDocBlock['tags'])) { |
|
283 | 283 | foreach ($methodDocBlock['tags'] as $tag) { |
284 | 284 | if ($tag->getName() === 'group') { |
285 | 285 | $routeGroupParts = explode("\n", trim($tag->getContent())); |
@@ -346,25 +346,25 @@ discard block |
||
346 | 346 | $faker->seed($this->config->get('faker_seed')); |
347 | 347 | } |
348 | 348 | $fakeFactories = [ |
349 | - 'integer' => function () use ($faker) { |
|
349 | + 'integer' => function() use ($faker) { |
|
350 | 350 | return $faker->numberBetween(1, 20); |
351 | 351 | }, |
352 | - 'number' => function () use ($faker) { |
|
352 | + 'number' => function() use ($faker) { |
|
353 | 353 | return $faker->randomFloat(); |
354 | 354 | }, |
355 | - 'float' => function () use ($faker) { |
|
355 | + 'float' => function() use ($faker) { |
|
356 | 356 | return $faker->randomFloat(); |
357 | 357 | }, |
358 | - 'boolean' => function () use ($faker) { |
|
358 | + 'boolean' => function() use ($faker) { |
|
359 | 359 | return $faker->boolean(); |
360 | 360 | }, |
361 | - 'string' => function () use ($faker) { |
|
361 | + 'string' => function() use ($faker) { |
|
362 | 362 | return $faker->word; |
363 | 363 | }, |
364 | - 'array' => function () { |
|
364 | + 'array' => function() { |
|
365 | 365 | return []; |
366 | 366 | }, |
367 | - 'object' => function () { |
|
367 | + 'object' => function() { |
|
368 | 368 | return new \stdClass; |
369 | 369 | }, |
370 | 370 | ]; |