Completed
Pull Request — master (#531)
by
unknown
01:35
created
src/Tools/Generator.php 2 patches
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     /**
29 29
      * @param Route $route
30 30
      *
31
-     * @return mixed
31
+     * @return string
32 32
      */
33 33
     public function getUri(Route $route)
34 34
     {
@@ -47,7 +47,6 @@  discard block
 block discarded – undo
47 47
 
48 48
     /**
49 49
      * @param  \Illuminate\Routing\Route $route
50
-     * @param array $apply Rules to apply when generating documentation for this route
51 50
      *
52 51
      * @return array
53 52
      */
@@ -95,7 +94,7 @@  discard block
 block discarded – undo
95 94
      * @param ReflectionMethod $method
96 95
      * @param array $tags
97 96
      *
98
-     * @return array
97
+     * @return Route
99 98
      */
100 99
     protected function getUriParameters(ReflectionMethod $method, array $tags)
101 100
     {
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
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'],
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             'cleanQueryParameters' => $this->cleanParams($queryParameters),
85 85
             'authenticated' => $this->getAuthStatusFromDocBlock($docBlock['tags']),
86 86
             'response' => $content,
87
-            'showresponse' => ! empty($content),
87
+            'showresponse' => !empty($content),
88 88
         ];
89 89
         $parsedRoute['headers'] = $rulesToApply['headers'] ?? [];
90 90
 
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
     protected function getUriParametersFromDocBlock(array $tags)
137 137
     {
138 138
         $parameters = collect($tags)
139
-            ->filter(function ($tag) {
139
+            ->filter(function($tag) {
140 140
                 return $tag instanceof Tag && $tag->getName() === 'uriParam';
141 141
             })
142
-            ->mapWithKeys(function ($tag) {
142
+            ->mapWithKeys(function($tag) {
143 143
                 preg_match('/(.+?)\s+(.+?)\s+?(.*)/', $tag->getContent(), $content);
144 144
                 if (empty($content)) {
145 145
                     // this means only name and type were supplied
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
     protected function getBodyParametersFromDocBlock(array $tags)
201 201
     {
202 202
         $parameters = collect($tags)
203
-            ->filter(function ($tag) {
203
+            ->filter(function($tag) {
204 204
                 return $tag instanceof Tag && $tag->getName() === 'bodyParam';
205 205
             })
206
-            ->mapWithKeys(function ($tag) {
206
+            ->mapWithKeys(function($tag) {
207 207
                 preg_match('/(.+?)\s+(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
208 208
                 if (empty($content)) {
209 209
                     // this means only name and type were supplied
@@ -275,10 +275,10 @@  discard block
 block discarded – undo
275 275
     protected function getQueryParametersFromDocBlock(array $tags)
276 276
     {
277 277
         $parameters = collect($tags)
278
-            ->filter(function ($tag) {
278
+            ->filter(function($tag) {
279 279
                 return $tag instanceof Tag && $tag->getName() === 'queryParam';
280 280
             })
281
-            ->mapWithKeys(function ($tag) {
281
+            ->mapWithKeys(function($tag) {
282 282
                 preg_match('/(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
283 283
                 if (empty($content)) {
284 284
                     // this means only name was supplied
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     protected function getAuthStatusFromDocBlock(array $tags)
317 317
     {
318 318
         $authTag = collect($tags)
319
-            ->first(function ($tag) {
319
+            ->first(function($tag) {
320 320
                 return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated';
321 321
             });
322 322
 
@@ -390,25 +390,25 @@  discard block
 block discarded – undo
390 390
             $faker->seed($this->config->get('faker_seed'));
391 391
         }
392 392
         $fakeFactories = [
393
-            'integer' => function () use ($faker) {
393
+            'integer' => function() use ($faker) {
394 394
                 return $faker->numberBetween(1, 20);
395 395
             },
396
-            'number' => function () use ($faker) {
396
+            'number' => function() use ($faker) {
397 397
                 return $faker->randomFloat();
398 398
             },
399
-            'float' => function () use ($faker) {
399
+            'float' => function() use ($faker) {
400 400
                 return $faker->randomFloat();
401 401
             },
402
-            'boolean' => function () use ($faker) {
402
+            'boolean' => function() use ($faker) {
403 403
                 return $faker->boolean();
404 404
             },
405
-            'string' => function () use ($faker) {
405
+            'string' => function() use ($faker) {
406 406
                 return $faker->word;
407 407
             },
408
-            'array' => function () {
408
+            'array' => function() {
409 409
                 return [];
410 410
             },
411
-            'object' => function () {
411
+            'object' => function() {
412 412
                 return new \stdClass;
413 413
             },
414 414
         ];
Please login to merge, or discard this patch.