Completed
Pull Request — master (#445)
by
unknown
02:02
created
src/Tools/Generator.php 1 patch
Spacing   +14 added lines, -14 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
 
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
     protected function getBodyParametersFromDocBlock(array $tags)
85 85
     {
86 86
         $parameters = collect($tags)
87
-            ->filter(function ($tag) {
87
+            ->filter(function($tag) {
88 88
                 return $tag instanceof Tag && $tag->getName() === 'bodyParam';
89 89
             })
90
-            ->mapWithKeys(function ($tag) {
90
+            ->mapWithKeys(function($tag) {
91 91
                 preg_match('/(.+?)\s+(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
92 92
                 if (empty($content)) {
93 93
                     // this means only name and type were supplied
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
     protected function getQueryParametersFromDocBlock(array $tags)
123 123
     {
124 124
         $parameters = collect($tags)
125
-            ->filter(function ($tag) {
125
+            ->filter(function($tag) {
126 126
                 return $tag instanceof Tag && $tag->getName() === 'queryParam';
127 127
             })
128
-            ->mapWithKeys(function ($tag) {
128
+            ->mapWithKeys(function($tag) {
129 129
                 preg_match('/(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
130 130
                 if (empty($content)) {
131 131
                     // this means only name was supplied
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     protected function getAuthStatusFromDocBlock(array $tags)
164 164
     {
165 165
         $authTag = collect($tags)
166
-            ->first(function ($tag) {
166
+            ->first(function($tag) {
167 167
                 return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated';
168 168
             });
169 169
 
@@ -234,25 +234,25 @@  discard block
 block discarded – undo
234 234
     {
235 235
         $faker = Factory::create();
236 236
         $fakes = [
237
-            'integer' => function () {
237
+            'integer' => function() {
238 238
                 return rand(1, 20);
239 239
             },
240
-            'number' => function () use ($faker) {
240
+            'number' => function() use ($faker) {
241 241
                 return $faker->randomFloat();
242 242
             },
243
-            'float' => function () use ($faker) {
243
+            'float' => function() use ($faker) {
244 244
                 return $faker->randomFloat();
245 245
             },
246
-            'boolean' => function () use ($faker) {
246
+            'boolean' => function() use ($faker) {
247 247
                 return $faker->boolean();
248 248
             },
249
-            'string' => function () use ($faker) {
249
+            'string' => function() use ($faker) {
250 250
                 return str_random();
251 251
             },
252
-            'array' => function () {
252
+            'array' => function() {
253 253
                 return [];
254 254
             },
255
-            'object' => function () {
255
+            'object' => function() {
256 256
                 return new \stdClass;
257 257
             },
258 258
         ];
Please login to merge, or discard this patch.