Completed
Pull Request — master (#504)
by
unknown
12:47 queued 08:40
created
src/Tools/Generator.php 1 patch
Spacing   +14 added lines, -14 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'],
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
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
 
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
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
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
@@ -317,25 +317,25 @@  discard block
 block discarded – undo
317 317
             $faker->seed($this->fakerSeed);
318 318
         }
319 319
         $fakeFactories = [
320
-            'integer' => function () use ($faker) {
320
+            'integer' => function() use ($faker) {
321 321
                 return $faker->numberBetween(1, 20);
322 322
             },
323
-            'number' => function () use ($faker) {
323
+            'number' => function() use ($faker) {
324 324
                 return $faker->randomFloat();
325 325
             },
326
-            'float' => function () use ($faker) {
326
+            'float' => function() use ($faker) {
327 327
                 return $faker->randomFloat();
328 328
             },
329
-            'boolean' => function () use ($faker) {
329
+            'boolean' => function() use ($faker) {
330 330
                 return $faker->boolean();
331 331
             },
332
-            'string' => function () use ($faker) {
332
+            'string' => function() use ($faker) {
333 333
                 return $faker->word;
334 334
             },
335
-            'array' => function () {
335
+            'array' => function() {
336 336
                 return [];
337 337
             },
338
-            'object' => function () {
338
+            'object' => function() {
339 339
                 return new \stdClass;
340 340
             },
341 341
         ];
Please login to merge, or discard this patch.