@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | // for each ruleset in the config file. Not a high priority, though. |
54 | 54 | private function getAllRoutes(bool $usingDingoRouter, array $versions = []) |
55 | 55 | { |
56 | - if (! $usingDingoRouter) { |
|
56 | + if (!$usingDingoRouter) { |
|
57 | 57 | return RouteFacade::getRoutes(); |
58 | 58 | } |
59 | 59 | |
60 | 60 | $allRouteCollections = app(\Dingo\Api\Routing\Router::class)->getRoutes(); |
61 | 61 | |
62 | 62 | return collect($allRouteCollections) |
63 | - ->flatMap(function (RouteCollection $collection) { |
|
63 | + ->flatMap(function(RouteCollection $collection) { |
|
64 | 64 | return $collection->getRoutes(); |
65 | 65 | })->toArray(); |
66 | 66 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | private function shouldIncludeRoute(Route $route, array $routeRule, array $mustIncludes, bool $usingDingoRouter) |
69 | 69 | { |
70 | 70 | $matchesVersion = $usingDingoRouter |
71 | - ? ! empty(array_intersect($route->versions(), $routeRule['match']['versions'] ?? [])) |
|
71 | + ? !empty(array_intersect($route->versions(), $routeRule['match']['versions'] ?? [])) |
|
72 | 72 | : true; |
73 | 73 | |
74 | 74 | return str_is($mustIncludes, $route->getName()) |
@@ -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 | 'groupName' => $routeGroupName, |
74 | 74 | 'groupDescription' => $routeGroupDescription, |
75 | 75 | 'title' => $routeTitle ?: $docBlock['short'], |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | 'cleanQueryParameters' => $this->cleanParams($queryParameters), |
84 | 84 | 'authenticated' => $this->getAuthStatusFromDocBlock($docBlock['tags']), |
85 | 85 | 'response' => $content, |
86 | - 'showresponse' => ! empty($content), |
|
86 | + 'showresponse' => !empty($content), |
|
87 | 87 | ]; |
88 | 88 | $parsedRoute['headers'] = $rulesToApply['headers'] ?? []; |
89 | 89 | |
@@ -129,10 +129,10 @@ discard block |
||
129 | 129 | protected function getBodyParametersFromDocBlock(array $tags) |
130 | 130 | { |
131 | 131 | $parameters = collect($tags) |
132 | - ->filter(function ($tag) { |
|
132 | + ->filter(function($tag) { |
|
133 | 133 | return $tag instanceof Tag && $tag->getName() === 'bodyParam'; |
134 | 134 | }) |
135 | - ->mapWithKeys(function ($tag) { |
|
135 | + ->mapWithKeys(function($tag) { |
|
136 | 136 | preg_match('/(.+?)\s+(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content); |
137 | 137 | if (empty($content)) { |
138 | 138 | // this means only name and type were supplied |
@@ -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 | if (empty($content)) { |
213 | 213 | // this means only name was supplied |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | protected function getAuthStatusFromDocBlock(array $tags) |
246 | 246 | { |
247 | 247 | $authTag = collect($tags) |
248 | - ->first(function ($tag) { |
|
248 | + ->first(function($tag) { |
|
249 | 249 | return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated'; |
250 | 250 | }); |
251 | 251 | |
@@ -344,25 +344,25 @@ discard block |
||
344 | 344 | $faker->seed($this->config->get('faker_seed')); |
345 | 345 | } |
346 | 346 | $fakeFactories = [ |
347 | - 'integer' => function () use ($faker) { |
|
347 | + 'integer' => function() use ($faker) { |
|
348 | 348 | return $faker->numberBetween(1, 20); |
349 | 349 | }, |
350 | - 'number' => function () use ($faker) { |
|
350 | + 'number' => function() use ($faker) { |
|
351 | 351 | return $faker->randomFloat(); |
352 | 352 | }, |
353 | - 'float' => function () use ($faker) { |
|
353 | + 'float' => function() use ($faker) { |
|
354 | 354 | return $faker->randomFloat(); |
355 | 355 | }, |
356 | - 'boolean' => function () use ($faker) { |
|
356 | + 'boolean' => function() use ($faker) { |
|
357 | 357 | return $faker->boolean(); |
358 | 358 | }, |
359 | - 'string' => function () use ($faker) { |
|
359 | + 'string' => function() use ($faker) { |
|
360 | 360 | return $faker->word; |
361 | 361 | }, |
362 | - 'array' => function () { |
|
362 | + 'array' => function() { |
|
363 | 363 | return []; |
364 | 364 | }, |
365 | - 'object' => function () { |
|
365 | + 'object' => function() { |
|
366 | 366 | return new \stdClass; |
367 | 367 | }, |
368 | 368 | ]; |