Completed
Pull Request — master (#460)
by
unknown
01:39
created
src/Tools/Generator.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         ]);
59 59
 
60 60
         $parsedRoute = [
61
-            'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))),
61
+            'id' => md5($this->getUri($route) . ':' . implode($this->getMethods($route))),
62 62
             'group' => $routeGroup,
63 63
             'title' => $docBlock['short'],
64 64
             'description' => $docBlock['long'],
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             'queryParameters' => $queryParameters,
70 70
             'authenticated' => $this->getAuthStatusFromDocBlock($docBlock['tags']),
71 71
             'response' => $content,
72
-            'showresponse' => ! empty($content),
72
+            'showresponse' => !empty($content),
73 73
         ];
74 74
         $parsedRoute['headers'] = $rulesToApply['headers'] ?? [];
75 75
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     {
81 81
         /** @var ReflectionClass $cls */
82 82
         $cls = collect($method->getParameters())
83
-            ->reduce(function ($carry, $param) use ($method) {
83
+            ->reduce(function($carry, $param) use ($method) {
84 84
                 if (!$param->getType()) {
85 85
                     return $carry;
86 86
                 }
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
     protected function getBodyParametersFromDocBlock(array $tags)
115 115
     {
116 116
         $parameters = collect($tags)
117
-            ->filter(function ($tag) {
117
+            ->filter(function($tag) {
118 118
                 return $tag instanceof Tag && $tag->getName() === 'bodyParam';
119 119
             })
120
-            ->mapWithKeys(function ($tag) {
120
+            ->mapWithKeys(function($tag) {
121 121
                 preg_match('/(.+?)\s+(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
122 122
                 if (empty($content)) {
123 123
                     // this means only name and type were supplied
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
     protected function getQueryParametersFromDocBlock(array $tags)
153 153
     {
154 154
         $parameters = collect($tags)
155
-            ->filter(function ($tag) {
155
+            ->filter(function($tag) {
156 156
                 return $tag instanceof Tag && $tag->getName() === 'queryParam';
157 157
             })
158
-            ->mapWithKeys(function ($tag) {
158
+            ->mapWithKeys(function($tag) {
159 159
                 preg_match('/(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
160 160
                 if (empty($content)) {
161 161
                     // this means only name was supplied
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     protected function getAuthStatusFromDocBlock(array $tags)
194 194
     {
195 195
         $authTag = collect($tags)
196
-            ->first(function ($tag) {
196
+            ->first(function($tag) {
197 197
                 return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated';
198 198
             });
199 199
 
@@ -264,25 +264,25 @@  discard block
 block discarded – undo
264 264
     {
265 265
         $faker = Factory::create();
266 266
         $fakes = [
267
-            'integer' => function () {
267
+            'integer' => function() {
268 268
                 return rand(1, 20);
269 269
             },
270
-            'number' => function () use ($faker) {
270
+            'number' => function() use ($faker) {
271 271
                 return $faker->randomFloat();
272 272
             },
273
-            'float' => function () use ($faker) {
273
+            'float' => function() use ($faker) {
274 274
                 return $faker->randomFloat();
275 275
             },
276
-            'boolean' => function () use ($faker) {
276
+            'boolean' => function() use ($faker) {
277 277
                 return $faker->boolean();
278 278
             },
279
-            'string' => function () use ($faker) {
279
+            'string' => function() use ($faker) {
280 280
                 return str_random();
281 281
             },
282
-            'array' => function () {
282
+            'array' => function() {
283 283
                 return [];
284 284
             },
285
-            'object' => function () {
285
+            'object' => function() {
286 286
                 return new \stdClass;
287 287
             },
288 288
         ];
Please login to merge, or discard this patch.