@@ -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 | 'cleanBodyParameters' => $this->cleanParams($bodyParameters), |
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 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | continue; |
107 | 107 | } |
108 | 108 | |
109 | - if ( class_exists('\Illuminate\Foundation\Http\FormRequest') && $parameterClass->isSubclassOf(\Illuminate\Foundation\Http\FormRequest::class) || class_exists('\Dingo\Api\Http\FormRequest') && $parameterClass->isSubclassOf(\Dingo\Api\Http\FormRequest::class)) { |
|
109 | + if (class_exists('\Illuminate\Foundation\Http\FormRequest') && $parameterClass->isSubclassOf(\Illuminate\Foundation\Http\FormRequest::class) || class_exists('\Dingo\Api\Http\FormRequest') && $parameterClass->isSubclassOf(\Dingo\Api\Http\FormRequest::class)) { |
|
110 | 110 | $formRequestDocBlock = new DocBlock($parameterClass->getDocComment()); |
111 | 111 | $bodyParametersFromDocBlock = $this->getBodyParametersFromDocBlock($formRequestDocBlock->getTags()); |
112 | 112 | |
@@ -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 |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | continue; |
182 | 182 | } |
183 | 183 | |
184 | - if ( class_exists('\Illuminate\Foundation\Http\FormRequest') && $parameterClass->isSubclassOf(\Illuminate\Foundation\Http\FormRequest::class) || class_exists('\Dingo\Api\Http\FormRequest') && $parameterClass->isSubclassOf(\Dingo\Api\Http\FormRequest::class)) { |
|
184 | + if (class_exists('\Illuminate\Foundation\Http\FormRequest') && $parameterClass->isSubclassOf(\Illuminate\Foundation\Http\FormRequest::class) || class_exists('\Dingo\Api\Http\FormRequest') && $parameterClass->isSubclassOf(\Dingo\Api\Http\FormRequest::class)) { |
|
185 | 185 | $formRequestDocBlock = new DocBlock($parameterClass->getDocComment()); |
186 | 186 | $queryParametersFromDocBlock = $this->getQueryParametersFromDocBlock($formRequestDocBlock->getTags()); |
187 | 187 | |
@@ -202,10 +202,10 @@ discard block |
||
202 | 202 | protected function getQueryParametersFromDocBlock(array $tags) |
203 | 203 | { |
204 | 204 | $parameters = collect($tags) |
205 | - ->filter(function ($tag) { |
|
205 | + ->filter(function($tag) { |
|
206 | 206 | return $tag instanceof Tag && $tag->getName() === 'queryParam'; |
207 | 207 | }) |
208 | - ->mapWithKeys(function ($tag) { |
|
208 | + ->mapWithKeys(function($tag) { |
|
209 | 209 | preg_match('/(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content); |
210 | 210 | if (empty($content)) { |
211 | 211 | // this means only name was supplied |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | protected function getAuthStatusFromDocBlock(array $tags) |
244 | 244 | { |
245 | 245 | $authTag = collect($tags) |
246 | - ->first(function ($tag) { |
|
246 | + ->first(function($tag) { |
|
247 | 247 | return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated'; |
248 | 248 | }); |
249 | 249 | |
@@ -318,25 +318,25 @@ discard block |
||
318 | 318 | $faker->seed($this->fakerSeed); |
319 | 319 | } |
320 | 320 | $fakeFactories = [ |
321 | - 'integer' => function () use ($faker) { |
|
321 | + 'integer' => function() use ($faker) { |
|
322 | 322 | return $faker->numberBetween(1, 20); |
323 | 323 | }, |
324 | - 'number' => function () use ($faker) { |
|
324 | + 'number' => function() use ($faker) { |
|
325 | 325 | return $faker->randomFloat(); |
326 | 326 | }, |
327 | - 'float' => function () use ($faker) { |
|
327 | + 'float' => function() use ($faker) { |
|
328 | 328 | return $faker->randomFloat(); |
329 | 329 | }, |
330 | - 'boolean' => function () use ($faker) { |
|
330 | + 'boolean' => function() use ($faker) { |
|
331 | 331 | return $faker->boolean(); |
332 | 332 | }, |
333 | - 'string' => function () use ($faker) { |
|
333 | + 'string' => function() use ($faker) { |
|
334 | 334 | return $faker->word; |
335 | 335 | }, |
336 | - 'array' => function () { |
|
336 | + 'array' => function() { |
|
337 | 337 | return []; |
338 | 338 | }, |
339 | - 'object' => function () { |
|
339 | + 'object' => function() { |
|
340 | 340 | return new \stdClass; |
341 | 341 | }, |
342 | 342 | ]; |