Completed
Pull Request — master (#372)
by
unknown
01:58
created
src/Generators/LaravelGenerator.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,6 @@
 block discarded – undo
41 41
     /**
42 42
      * Prepares / Disables route middlewares.
43 43
      *
44
-     * @param  bool $disable
45 44
      *
46 45
      * @return  void
47 46
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
      */
58 58
     public function prepareMiddleware($enable = true)
59 59
     {
60
-        App::instance('middleware.disable', ! $enable);
60
+        App::instance('middleware.disable', !$enable);
61 61
     }
62 62
 
63 63
     /**
Please login to merge, or discard this patch.
src/Generators/DingoGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     {
26 26
         $dispatcher = app('Dingo\Api\Dispatcher')->raw();
27 27
 
28
-        collect($server)->map(function ($key, $value) use ($dispatcher) {
28
+        collect($server)->map(function($key, $value) use ($dispatcher) {
29 29
             $dispatcher->header($value, $key);
30 30
         });
31 31
 
Please login to merge, or discard this patch.
src/Postman/CollectionWriter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
                 'description' => '',
33 33
                 'schema' => 'https://schema.getpostman.com/json/collection/v2.0.0/collection.json',
34 34
             ],
35
-            'item' => $this->routeGroups->map(function ($routes, $groupName) {
35
+            'item' => $this->routeGroups->map(function($routes, $groupName) {
36 36
                 return [
37 37
                     'name' => $groupName,
38 38
                     'description' => '',
39
-                    'item' => $routes->map(function ($route) {
39
+                    'item' => $routes->map(function($route) {
40 40
                         return [
41 41
                             'name' => $route['title'] != '' ? $route['title'] : url($route['uri']),
42 42
                             'request' => [
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                                 'method' => $route['methods'][0],
45 45
                                 'body' => [
46 46
                                     'mode' => 'formdata',
47
-                                    'formdata' => collect($route['parameters'])->map(function ($parameter, $key) {
47
+                                    'formdata' => collect($route['parameters'])->map(function($parameter, $key) {
48 48
                                         return [
49 49
                                             'key' => $key,
50 50
                                             'value' => isset($parameter['value']) ? $parameter['value'] : '',
Please login to merge, or discard this patch.
src/Tools/RouteMatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
 
49 49
     private function getAllRoutes(bool $usingDingoRouter, array $versions = [])
50 50
     {
51
-        if (! $usingDingoRouter) {
51
+        if (!$usingDingoRouter) {
52 52
             return RouteFacade::getRoutes();
53 53
         }
54 54
 
55 55
         $allRouteCollections = app(\Dingo\Api\Routing\Router::class)->getRoutes();
56 56
 
57 57
         return collect($allRouteCollections)
58
-            ->flatMap(function (RouteCollection $collection) {
58
+            ->flatMap(function(RouteCollection $collection) {
59 59
                 return $collection->getRoutes();
60 60
             })->toArray();
61 61
     }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     private function shouldIncludeRoute(Route $route, array $routeRule, array $mustIncludes, bool $usingDingoRouter)
64 64
     {
65 65
         $matchesVersion = $usingDingoRouter
66
-            ? ! empty(array_intersect($route->versions(), $routeRule['match']['versions'] ?? []))
66
+            ? !empty(array_intersect($route->versions(), $routeRule['match']['versions'] ?? []))
67 67
             : true;
68 68
 
69 69
         return in_array($route->getName(), $mustIncludes)
Please login to merge, or discard this patch.
src/ApiDocGeneratorServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,17 +15,17 @@
 block discarded – undo
15 15
      */
16 16
     public function boot()
17 17
     {
18
-        $this->loadViewsFrom(__DIR__.'/../resources/views/', 'apidoc');
18
+        $this->loadViewsFrom(__DIR__ . '/../resources/views/', 'apidoc');
19 19
 
20 20
         $this->publishes([
21
-            __DIR__.'/../resources/views' => app()->basePath().'/resources/views/vendor/apidoc',
21
+            __DIR__ . '/../resources/views' => app()->basePath() . '/resources/views/vendor/apidoc',
22 22
         ], 'views');
23 23
 
24 24
         $this->publishes([
25
-            __DIR__.'/../config/apidoc.php' => config_path('apidoc.php'),
25
+            __DIR__ . '/../config/apidoc.php' => config_path('apidoc.php'),
26 26
         ], 'config');
27 27
 
28
-        $this->mergeConfigFrom(__DIR__.'/../config/apidoc.php', 'apidoc');
28
+        $this->mergeConfigFrom(__DIR__ . '/../config/apidoc.php', 'apidoc');
29 29
 
30 30
         if ($this->app->runningInConsole()) {
31 31
             $this->commands([
Please login to merge, or discard this patch.
src/Commands/UpdateDocumentation.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,15 +42,15 @@
 block discarded – undo
42 42
 
43 43
         $documentarian = new Documentarian();
44 44
 
45
-        if (! is_dir($outputPath)) {
46
-            $this->error('There is no existing documentation available at '.$outputPath.'.');
45
+        if (!is_dir($outputPath)) {
46
+            $this->error('There is no existing documentation available at ' . $outputPath . '.');
47 47
 
48 48
             return false;
49 49
         }
50
-        $this->info('Rebuilding API HTML code from '.$outputPath.'/source/index.md');
50
+        $this->info('Rebuilding API HTML code from ' . $outputPath . '/source/index.md');
51 51
 
52 52
         $documentarian->generate($outputPath);
53 53
 
54
-        $this->info('Wrote HTML documentation to: '.$outputPath.'/index.html');
54
+        $this->info('Wrote HTML documentation to: ' . $outputPath . '/index.html');
55 55
     }
56 56
 }
Please login to merge, or discard this patch.
src/Commands/GenerateDocumentation.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         $parsedRoutes = $this->processRoutes($generator, $routes);
60 60
         $parsedRoutes = collect($parsedRoutes)->groupBy('group')
61
-            ->sort(function ($a, $b) {
61
+            ->sort(function($a, $b) {
62 62
                 return strcmp($a->first()['group'], $b->first()['group']);
63 63
             });
64 64
 
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
     private function writeMarkdown($parsedRoutes)
74 74
     {
75 75
         $outputPath = config('apidoc.output');
76
-        $targetFile = $outputPath.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'index.md';
77
-        $compareFile = $outputPath.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'.compare.md';
78
-        $prependFile = $outputPath.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'prepend.md';
79
-        $appendFile = $outputPath.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'append.md';
76
+        $targetFile = $outputPath . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . 'index.md';
77
+        $compareFile = $outputPath . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . '.compare.md';
78
+        $prependFile = $outputPath . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . 'prepend.md';
79
+        $appendFile = $outputPath . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . 'append.md';
80 80
 
81 81
         $infoText = view('apidoc::partials.info')
82 82
             ->with('outputPath', ltrim($outputPath, 'public/'))
83 83
             ->with('showPostmanCollectionButton', config('apidoc.postman'));
84 84
 
85
-        $parsedRouteOutput = $parsedRoutes->map(function ($routeGroup) {
86
-            return $routeGroup->map(function ($route) {
85
+        $parsedRouteOutput = $parsedRoutes->map(function($routeGroup) {
86
+            return $routeGroup->map(function($route) {
87 87
                 $route['output'] = (string) view('apidoc::partials.route')->with('route', $route)->render();
88 88
 
89 89
                 return $route;
@@ -103,16 +103,16 @@  discard block
 block discarded – undo
103 103
                 $frontmatter = trim($generatedFrontmatter[1], "\n");
104 104
             }
105 105
 
106
-            $parsedRouteOutput->transform(function ($routeGroup) use ($generatedDocumentation, $compareDocumentation) {
107
-                return $routeGroup->transform(function ($route) use ($generatedDocumentation, $compareDocumentation) {
108
-                    if (preg_match('/<!-- START_'.$route['id'].' -->(.*)<!-- END_'.$route['id'].' -->/is', $generatedDocumentation, $existingRouteDoc)) {
109
-                        $routeDocumentationChanged = (preg_match('/<!-- START_'.$route['id'].' -->(.*)<!-- END_'.$route['id'].' -->/is', $compareDocumentation, $lastDocWeGeneratedForThisRoute) && $lastDocWeGeneratedForThisRoute[1] !== $existingRouteDoc[1]);
106
+            $parsedRouteOutput->transform(function($routeGroup) use ($generatedDocumentation, $compareDocumentation) {
107
+                return $routeGroup->transform(function($route) use ($generatedDocumentation, $compareDocumentation) {
108
+                    if (preg_match('/<!-- START_' . $route['id'] . ' -->(.*)<!-- END_' . $route['id'] . ' -->/is', $generatedDocumentation, $existingRouteDoc)) {
109
+                        $routeDocumentationChanged = (preg_match('/<!-- START_' . $route['id'] . ' -->(.*)<!-- END_' . $route['id'] . ' -->/is', $compareDocumentation, $lastDocWeGeneratedForThisRoute) && $lastDocWeGeneratedForThisRoute[1] !== $existingRouteDoc[1]);
110 110
                         if ($routeDocumentationChanged === false || $this->option('force')) {
111 111
                             if ($routeDocumentationChanged) {
112
-                                $this->warn('Discarded manual changes for route ['.implode(',', $route['methods']).'] '.$route['uri']);
112
+                                $this->warn('Discarded manual changes for route [' . implode(',', $route['methods']) . '] ' . $route['uri']);
113 113
                             }
114 114
                         } else {
115
-                            $this->warn('Skipping modified route ['.implode(',', $route['methods']).'] '.$route['uri']);
115
+                            $this->warn('Skipping modified route [' . implode(',', $route['methods']) . '] ' . $route['uri']);
116 116
                             $route['modified_output'] = $existingRouteDoc[0];
117 117
                         }
118 118
                     }
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
         }
124 124
 
125 125
         $prependFileContents = file_exists($prependFile)
126
-            ? file_get_contents($prependFile)."\n" : '';
126
+            ? file_get_contents($prependFile) . "\n" : '';
127 127
         $appendFileContents = file_exists($appendFile)
128
-            ? "\n".file_get_contents($appendFile) : '';
128
+            ? "\n" . file_get_contents($appendFile) : '';
129 129
 
130 130
         $documentarian = new Documentarian();
131 131
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             ->with('showPostmanCollectionButton', config('apidoc.postman'))
140 140
             ->with('parsedRoutes', $parsedRouteOutput);
141 141
 
142
-        if (! is_dir($outputPath)) {
142
+        if (!is_dir($outputPath)) {
143 143
             $documentarian->create($outputPath);
144 144
         }
145 145
 
@@ -159,18 +159,18 @@  discard block
 block discarded – undo
159 159
 
160 160
         file_put_contents($compareFile, $compareMarkdown);
161 161
 
162
-        $this->info('Wrote index.md to: '.$outputPath);
162
+        $this->info('Wrote index.md to: ' . $outputPath);
163 163
 
164 164
         $this->info('Generating API HTML code');
165 165
 
166 166
         $documentarian->generate($outputPath);
167 167
 
168
-        $this->info('Wrote HTML documentation to: '.$outputPath.'/index.html');
168
+        $this->info('Wrote HTML documentation to: ' . $outputPath . '/index.html');
169 169
 
170 170
         if (config('apidoc.postman')) {
171 171
             $this->info('Generating Postman collection');
172 172
 
173
-            file_put_contents($outputPath.DIRECTORY_SEPARATOR.'collection.json', $this->generatePostmanCollection($parsedRoutes));
173
+            file_put_contents($outputPath . DIRECTORY_SEPARATOR . 'collection.json', $this->generatePostmanCollection($parsedRoutes));
174 174
         }
175 175
     }
176 176
 
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
             /** @var Route $route */
189 189
             if ($this->isValidRoute($route) && $this->isRouteVisibleForDocumentation($route->getAction()['uses'])) {
190 190
                 $parsedRoutes[] = $generator->processRoute($route) + $routeItem['apply'];
191
-                $this->info('Processed route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route));
191
+                $this->info('Processed route: [' . implode(',', $generator->getMethods($route)) . '] ' . $generator->getUri($route));
192 192
             } else {
193
-                $this->warn('Skipping route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route));
193
+                $this->warn('Skipping route: [' . implode(',', $generator->getMethods($route)) . '] ' . $generator->getUri($route));
194 194
             }
195 195
         }
196 196
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
      */
205 205
     private function isValidRoute(Route $route)
206 206
     {
207
-        return ! is_callable($route->getAction()['uses']) && ! is_null($route->getAction()['uses']);
207
+        return !is_callable($route->getAction()['uses']) && !is_null($route->getAction()['uses']);
208 208
     }
209 209
 
210 210
     /**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             $phpdoc = new DocBlock($comment);
222 222
 
223 223
             return collect($phpdoc->getTags())
224
-                ->filter(function ($tag) use ($route) {
224
+                ->filter(function($tag) use ($route) {
225 225
                     return $tag->getName() === 'hideFromAPIDocumentation';
226 226
                 })
227 227
                 ->isEmpty();
Please login to merge, or discard this patch.
src/Generators/AbstractGenerator.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $content = $this->getResponse($docBlock['tags']);
59 59
 
60 60
         return [
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'],
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             'parameters' => $this->getParametersFromDocBlock($docBlock['tags']),
68 68
             'authenticated' => $this->getAuthStatusFromDocBlock($docBlock['tags']),
69 69
             'response' => $content,
70
-            'showresponse' => ! empty($content),
70
+            'showresponse' => !empty($content),
71 71
         ];
72 72
     }
73 73
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */
90 90
     protected function getDocblockResponse($tags)
91 91
     {
92
-        $responseTags = array_filter($tags, function ($tag) {
92
+        $responseTags = array_filter($tags, function($tag) {
93 93
             return $tag instanceof Tag && \strtolower($tag->getName()) == 'response';
94 94
         });
95 95
         if (empty($responseTags)) {
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
     protected function getParametersFromDocBlock(array $tags)
109 109
     {
110 110
         $parameters = collect($tags)
111
-            ->filter(function ($tag) {
111
+            ->filter(function($tag) {
112 112
                 return $tag instanceof Tag && $tag->getName() === 'bodyParam';
113 113
             })
114
-            ->mapWithKeys(function ($tag) {
114
+            ->mapWithKeys(function($tag) {
115 115
                 preg_match('/(.+?)\s+(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
116 116
                 if (empty($content)) {
117 117
                     // this means only name and type were supplied
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     protected function getAuthStatusFromDocBlock(array $tags)
146 146
     {
147 147
         $authTag = collect($tags)
148
-            ->first(function ($tag) {
148
+            ->first(function($tag) {
149 149
                 return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated';
150 150
             });
151 151
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $methods = $this->getMethods($route);
167 167
 
168 168
         // Split headers into key - value pairs
169
-        $headers = collect($headers)->map(function ($value) {
169
+        $headers = collect($headers)->map(function($value) {
170 170
             $split = explode(':', $value); // explode to get key + values
171 171
             $key = array_shift($split); // extract the key and keep the values in the array
172 172
             $value = implode(':', $split); // implode values into string again
@@ -190,8 +190,8 @@  discard block
 block discarded – undo
190 190
     {
191 191
         $uri = $this->getUri($route);
192 192
         foreach ($bindings as $model => $id) {
193
-            $uri = str_replace('{'.$model.'}', $id, $uri);
194
-            $uri = str_replace('{'.$model.'?}', $id, $uri);
193
+            $uri = str_replace('{' . $model . '}', $id, $uri);
194
+            $uri = str_replace('{' . $model . '?}', $id, $uri);
195 195
         }
196 196
 
197 197
         return $uri;
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
         foreach ($headers as $name => $value) {
271 271
             $name = strtr(strtoupper($name), '-', '_');
272 272
 
273
-            if (! Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') {
274
-                $name = $prefix.$name;
273
+            if (!Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') {
274
+                $name = $prefix . $name;
275 275
             }
276 276
 
277 277
             $server[$name] = $value;
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
     protected function getTransformerResponse($tags)
310 310
     {
311 311
         try {
312
-            $transFormerTags = array_filter($tags, function ($tag) {
313
-                if (! ($tag instanceof Tag)) {
312
+            $transFormerTags = array_filter($tags, function($tag) {
313
+                if (!($tag instanceof Tag)) {
314 314
                     return false;
315 315
                 }
316 316
 
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
                 return false;
322 322
             }
323 323
 
324
-            $modelTag = array_first(array_filter($tags, function ($tag) {
325
-                if (! ($tag instanceof Tag)) {
324
+            $modelTag = array_first(array_filter($tags, function($tag) {
325
+                if (!($tag instanceof Tag)) {
326 326
                     return false;
327 327
                 }
328 328
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
             }));
331 331
             $tag = \array_first($transFormerTags);
332 332
             $transformer = $tag->getContent();
333
-            if (! \class_exists($transformer)) {
333
+            if (!\class_exists($transformer)) {
334 334
                 // if we can't find the transformer we can't generate a response
335 335
                 return;
336 336
             }
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
             }
346 346
             if (\is_null($type)) {
347 347
                 if ($parameter->hasType() &&
348
-                    ! $parameter->getType()->isBuiltin() &&
348
+                    !$parameter->getType()->isBuiltin() &&
349 349
                     \class_exists((string) $parameter->getType())) {
350 350
                     //we have a type
351 351
                     $type = (string) $parameter->getType();
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
             // we have a response from the docblock ( @response )
399 399
             $response = $docblockResponse;
400 400
         }
401
-        if (! $response && ($transformerResponse = $this->getTransformerResponse($annotationTags))) {
401
+        if (!$response && ($transformerResponse = $this->getTransformerResponse($annotationTags))) {
402 402
             // we have a transformer response from the docblock ( @transformer || @transformercollection )
403 403
             $response = $transformerResponse;
404 404
         }
@@ -423,25 +423,25 @@  discard block
 block discarded – undo
423 423
     {
424 424
         $faker = Factory::create();
425 425
         $fakes = [
426
-            'integer' => function () {
426
+            'integer' => function() {
427 427
                 return rand(1, 20);
428 428
             },
429
-            'number' => function () use ($faker) {
429
+            'number' => function() use ($faker) {
430 430
                 return $faker->randomFloat();
431 431
             },
432
-            'float' => function () use ($faker) {
432
+            'float' => function() use ($faker) {
433 433
                 return $faker->randomFloat();
434 434
             },
435
-            'boolean' => function () use ($faker) {
435
+            'boolean' => function() use ($faker) {
436 436
                 return $faker->boolean();
437 437
             },
438
-            'string' => function () use ($faker) {
438
+            'string' => function() use ($faker) {
439 439
                 return str_random();
440 440
             },
441
-            'array' => function () {
441
+            'array' => function() {
442 442
                 return '[]';
443 443
             },
444
-            'object' => function () {
444
+            'object' => function() {
445 445
                 return '{}';
446 446
             },
447 447
         ];
Please login to merge, or discard this patch.
Doc Comments   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     /**
28 28
      * @param Route $route
29 29
      *
30
-     * @return mixed
30
+     * @return string
31 31
      */
32 32
     public function getUri(Route $route)
33 33
     {
@@ -46,7 +46,6 @@  discard block
 block discarded – undo
46 46
 
47 47
     /**
48 48
      * @param  \Illuminate\Routing\Route $route
49
-     * @param array $apply Rules to apply when generating documentation for this route
50 49
      *
51 50
      * @return array
52 51
      */
@@ -74,7 +73,6 @@  discard block
 block discarded – undo
74 73
     /**
75 74
      * Prepares / Disables route middlewares.
76 75
      *
77
-     * @param  bool $disable
78 76
      *
79 77
      * @return  void
80 78
      */
@@ -184,7 +182,7 @@  discard block
 block discarded – undo
184 182
      * @param $route
185 183
      * @param array $bindings
186 184
      *
187
-     * @return mixed
185
+     * @return string
188 186
      */
189 187
     protected function addRouteModelBindings($route, $bindings)
190 188
     {
@@ -200,7 +198,7 @@  discard block
 block discarded – undo
200 198
     /**
201 199
      * @param  \Illuminate\Routing\Route  $routeAction
202 200
      *
203
-     * @return array
201
+     * @return Route
204 202
      */
205 203
     protected function parseDocBlock(string $routeAction)
206 204
     {
@@ -421,6 +419,9 @@  discard block
 block discarded – undo
421 419
         return $content;
422 420
     }
423 421
 
422
+    /**
423
+     * @return string
424
+     */
424 425
     private function normalizeParameterType($type)
425 426
     {
426 427
         $typeMap = [
Please login to merge, or discard this patch.
src/Tools/ResponseResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
 
49 49
     private function getAllRoutes(bool $usingDingoRouter, array $versions = [])
50 50
     {
51
-        if (! $usingDingoRouter) {
51
+        if (!$usingDingoRouter) {
52 52
             return RouteFacade::getRoutes();
53 53
         }
54 54
 
55 55
         $allRouteCollections = app(\Dingo\Api\Routing\Router::class)->getRoutes();
56 56
 
57 57
         return collect($allRouteCollections)
58
-            ->flatMap(function (RouteCollection $collection) {
58
+            ->flatMap(function(RouteCollection $collection) {
59 59
                 return $collection->getRoutes();
60 60
             })->toArray();
61 61
     }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     private function shouldIncludeRoute(Route $route, array $routeRule, array $mustIncludes, bool $usingDingoRouter)
64 64
     {
65 65
         $matchesVersion = $usingDingoRouter
66
-            ? ! empty(array_intersect($route->versions(), $routeRule['match']['versions'] ?? []))
66
+            ? !empty(array_intersect($route->versions(), $routeRule['match']['versions'] ?? []))
67 67
             : true;
68 68
 
69 69
         return in_array($route->getName(), $mustIncludes)
Please login to merge, or discard this patch.