Completed
Pull Request — master (#203)
by Manash
02:19
created
src/Mpociot/ApiDoc/Commands/UpdateDocumentation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 
45 45
         $documentarian = new Documentarian();
46 46
 
47
-        if (! is_dir($outputPath)) {
48
-            $this->error('There is no generated documentation available at '.$outputPath.'.');
47
+        if (!is_dir($outputPath)) {
48
+            $this->error('There is no generated documentation available at ' . $outputPath . '.');
49 49
 
50 50
             return false;
51 51
         }
@@ -53,6 +53,6 @@  discard block
 block discarded – undo
53 53
 
54 54
         $documentarian->generate($outputPath);
55 55
 
56
-        $this->info('Wrote HTML documentation to: '.$outputPath.'/public/index.html');
56
+        $this->info('Wrote HTML documentation to: ' . $outputPath . '/public/index.html');
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
src/Mpociot/ApiDoc/Parsers/RuleDescriptionParser.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
     }
78 78
 
79 79
     /**
80
-     * @param null $rule
80
+     * @param string $rule
81 81
      *
82 82
      * @return static
83 83
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@  discard block
 block discarded – undo
34 34
     public function with($parameters)
35 35
     {
36 36
         is_array($parameters) ?
37
-            $this->parameters += $parameters :
38
-            $this->parameters[] = $parameters;
37
+            $this->parameters += $parameters : $this->parameters[] = $parameters;
39 38
 
40 39
         return $this;
41 40
     }
@@ -54,8 +53,7 @@  discard block
 block discarded – undo
54 53
     protected function makeDescription()
55 54
     {
56 55
         $description = trans()->hasForLocale($this->rule) ?
57
-                            trans()->get($this->rule) :
58
-                            trans()->get($this->rule, [], self::DEFAULT_LOCALE);
56
+                            trans()->get($this->rule) : trans()->get($this->rule, [], self::DEFAULT_LOCALE);
59 57
 
60 58
         return $this->replaceAttributes($description);
61 59
     }
Please login to merge, or discard this patch.
src/Mpociot/ApiDoc/ApiDocGeneratorServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
      */
16 16
     public function boot()
17 17
     {
18
-        $this->loadViewsFrom(__DIR__.'/../../resources/views/', 'apidoc');
19
-        $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'apidoc');
18
+        $this->loadViewsFrom(__DIR__ . '/../../resources/views/', 'apidoc');
19
+        $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'apidoc');
20 20
 
21 21
         $this->publishes([
22
-            __DIR__.'/../../resources/lang' => $this->resource_path('lang/vendor/apidoc'),
23
-            __DIR__.'/../../resources/views' => $this->resource_path('views/vendor/apidoc'),
22
+            __DIR__ . '/../../resources/lang' => $this->resource_path('lang/vendor/apidoc'),
23
+            __DIR__ . '/../../resources/views' => $this->resource_path('views/vendor/apidoc'),
24 24
         ]);
25 25
     }
26 26
 
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function register()
33 33
     {
34
-        $this->app->singleton('apidoc.generate', function () {
34
+        $this->app->singleton('apidoc.generate', function() {
35 35
             return new GenerateDocumentation();
36 36
         });
37
-        $this->app->singleton('apidoc.update', function () {
37
+        $this->app->singleton('apidoc.update', function() {
38 38
             return new UpdateDocumentation();
39 39
         });
40 40
 
@@ -53,6 +53,6 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function resource_path($path = '')
55 55
     {
56
-        return app()->basePath().'/resources'.($path ? '/'.$path : $path);
56
+        return app()->basePath() . '/resources' . ($path ? '/' . $path : $path);
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
src/Mpociot/ApiDoc/Generators/DingoGenerator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      *
47 47
      * @param  bool $disable
48 48
      *
49
-     * @return  void
49
+     * @return  boolean
50 50
      */
51 51
     public function prepareMiddleware($disable = true)
52 52
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $routeDescription = $this->getRouteDescription($routeAction['uses']);
31 31
 
32 32
         return $this->getParameters([
33
-            'id' => md5($route->uri().':'.implode($route->getMethods())),
33
+            'id' => md5($route->uri() . ':' . implode($route->getMethods())),
34 34
             'resource' => $routeGroup,
35 35
             'title' => $routeDescription['short'],
36 36
             'description' => $routeDescription['long'],
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $dispatcher = app('Dingo\Api\Dispatcher')->raw();
63 63
 
64
-        collect($server)->map(function ($key, $value) use ($dispatcher) {
64
+        collect($server)->map(function($key, $value) use ($dispatcher) {
65 65
             $dispatcher->header($value, $key);
66 66
         });
67 67
 
Please login to merge, or discard this patch.
src/Mpociot/ApiDoc/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/Mpociot/ApiDoc/Generators/AbstractGenerator.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
     /**
50 50
      * Get the response from the docblock if available.
51 51
      *
52
-     * @param array $tags
52
+     * @param Tag[] $tags
53 53
      *
54
-     * @return mixed
54
+     * @return null|\Symfony\Component\HttpFoundation\Response
55 55
      */
56 56
     protected function getDocblockResponse($tags)
57 57
     {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     }
99 99
 
100 100
     /**
101
-     * @param  $route
101
+     * @param  \Illuminate\Routing\Route $route
102 102
      * @param  $bindings
103 103
      * @param  $headers
104 104
      *
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
      * @param  string  $rule
514 514
      * @param  string  $parameter
515 515
      *
516
-     * @return array
516
+     * @return string
517 517
      */
518 518
     protected function parseParameters($rule, $parameter)
519 519
     {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
      */
56 56
     protected function getDocblockResponse($tags)
57 57
     {
58
-        $responseTags = array_filter($tags, function ($tag) {
59
-            if (! ($tag instanceof Tag)) {
58
+        $responseTags = array_filter($tags, function($tag) {
59
+            if (!($tag instanceof Tag)) {
60 60
                 return false;
61 61
             }
62 62
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $methods = $this->getMethods($route);
112 112
 
113 113
         // Split headers into key - value pairs
114
-        $headers = collect($headers)->map(function ($value) {
114
+        $headers = collect($headers)->map(function($value) {
115 115
             $split = explode(':', $value);
116 116
 
117 117
             return [trim($split[0]) => trim($split[1])];
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     {
134 134
         $uri = $this->getUri($route);
135 135
         foreach ($bindings as $model => $id) {
136
-            $uri = str_replace('{'.$model.'}', $id, $uri);
136
+            $uri = str_replace('{' . $model . '}', $id, $uri);
137 137
         }
138 138
 
139 139
         return $uri;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
         foreach ($reflectionMethod->getParameters() as $parameter) {
198 198
             $parameterType = $parameter->getClass();
199
-            if (! is_null($parameterType) && class_exists($parameterType->name)) {
199
+            if (!is_null($parameterType) && class_exists($parameterType->name)) {
200 200
                 $className = $parameterType->name;
201 201
 
202 202
                 if (is_subclass_of($className, FormRequest::class)) {
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
      */
227 227
     protected function fancyImplode($arr, $first, $last)
228 228
     {
229
-        $arr = array_map(function ($value) {
230
-            return '`'.$value.'`';
229
+        $arr = array_map(function($value) {
230
+            return '`' . $value . '`';
231 231
         }, $arr);
232 232
         array_push($arr, implode($last, array_splice($arr, -2)));
233 233
 
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
     protected function splitValuePairs($parameters, $first = 'is ', $last = 'or ')
238 238
     {
239 239
         $attribute = '';
240
-        collect($parameters)->map(function ($item, $key) use (&$attribute, $first, $last) {
241
-            $attribute .= '`'.$item.'` ';
240
+        collect($parameters)->map(function($item, $key) use (&$attribute, $first, $last) {
241
+            $attribute .= '`' . $item . '` ';
242 242
             if (($key + 1) % 2 === 0) {
243 243
                 $attribute .= $last;
244 244
             } else {
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
                 }
313 313
                 break;
314 314
             case 'between':
315
-                if (! isset($attributeData['type'])) {
315
+                if (!isset($attributeData['type'])) {
316 316
                     $attributeData['type'] = 'numeric';
317 317
                 }
318 318
                 $attributeData['description'][] = Description::parse($rule)->with($parameters)->getDescription();
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
         foreach ($headers as $name => $value) {
475 475
             $name = strtr(strtoupper($name), '-', '_');
476 476
 
477
-            if (! Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') {
478
-                $name = $prefix.$name;
477
+            if (!Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') {
478
+                $name = $prefix . $name;
479 479
             }
480 480
 
481 481
             $server[$name] = $value;
Please login to merge, or discard this patch.
src/Mpociot/ApiDoc/Generators/LaravelGenerator.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     /**
32 32
      * @param Route $route
33 33
      *
34
-     * @return mixed
34
+     * @return string
35 35
      */
36 36
     public function getMethods($route)
37 37
     {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     /**
152 152
      * Get a response from the transformer tags.
153 153
      *
154
-     * @param array $tags
154
+     * @param Tag[] $tags
155 155
      *
156 156
      * @return mixed
157 157
      */
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 $response = $docblockResponse;
68 68
                 $showresponse = true;
69 69
             }
70
-            if (! $response) {
70
+            if (!$response) {
71 71
                 $transformerResponse = $this->getTransformerResponse($routeDescription['tags']);
72 72
                 if ($transformerResponse) {
73 73
                     // we have a transformer response from the docblock ( @transformer || @transformercollection )
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                     $showresponse = true;
76 76
                 }
77 77
             }
78
-            if (! $response) {
78
+            if (!$response) {
79 79
                 $response = $this->getRouteResponse($route, $bindings, $headers);
80 80
             }
81 81
             if ($response->headers->get('Content-Type') === 'application/json') {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         }
87 87
 
88 88
         return $this->getParameters([
89
-            'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))),
89
+            'id' => md5($this->getUri($route) . ':' . implode($this->getMethods($route))),
90 90
             'resource' => $routeGroup,
91 91
             'title' => $routeDescription['short'],
92 92
             'description' => $routeDescription['long'],
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         $kernel->terminate($request, $response);
142 142
 
143
-        if (file_exists($file = App::bootstrapPath().'/app.php')) {
143
+        if (file_exists($file = App::bootstrapPath() . '/app.php')) {
144 144
             $app = require $file;
145 145
             $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
146 146
         }
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
     protected function getTransformerResponse($tags)
159 159
     {
160 160
         try {
161
-            $transFormerTags = array_filter($tags, function ($tag) {
162
-                if (! ($tag instanceof Tag)) {
161
+            $transFormerTags = array_filter($tags, function($tag) {
162
+                if (!($tag instanceof Tag)) {
163 163
                     return false;
164 164
                 }
165 165
 
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
                 return false;
171 171
             }
172 172
 
173
-            $modelTag = array_first(array_filter($tags, function ($tag) {
174
-                if (! ($tag instanceof Tag)) {
173
+            $modelTag = array_first(array_filter($tags, function($tag) {
174
+                if (!($tag instanceof Tag)) {
175 175
                     return false;
176 176
                 }
177 177
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             }));
180 180
             $tag = \array_first($transFormerTags);
181 181
             $transformer = $tag->getContent();
182
-            if (! \class_exists($transformer)) {
182
+            if (!\class_exists($transformer)) {
183 183
                 // if we can't find the transformer we can't generate a response
184 184
                 return;
185 185
             }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             if (version_compare(PHP_VERSION, '7.0.0') >= 0 && \is_null($type)) {
196 196
                 // we can only get the type with reflection for PHP 7
197 197
                 if ($parameter->hasType() &&
198
-                ! $parameter->getType()->isBuiltin() &&
198
+                !$parameter->getType()->isBuiltin() &&
199 199
                 \class_exists((string) $parameter->getType())) {
200 200
                     //we have a type
201 201
                     $type = (string) $parameter->getType();
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 
256 256
         foreach ($reflectionMethod->getParameters() as $parameter) {
257 257
             $parameterType = $parameter->getClass();
258
-            if (! is_null($parameterType) && class_exists($parameterType->name)) {
258
+            if (!is_null($parameterType) && class_exists($parameterType->name)) {
259 259
                 $className = $parameterType->name;
260 260
 
261 261
                 if (is_subclass_of($className, FormRequest::class)) {
Please login to merge, or discard this patch.
src/Mpociot/ApiDoc/Commands/GenerateDocumentation.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $this->setUserToBeImpersonated($this->option('actAsUserId'));
73 73
 
74
-        if ($routePrefix === null && ! count($allowedRoutes) && $middleware === null) {
74
+        if ($routePrefix === null && !count($allowedRoutes) && $middleware === null) {
75 75
             $this->error('You must provide either a route prefix or a route or a middleware to generate the documentation.');
76 76
 
77 77
             return false;
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
         $routePrefixes = explode(",", $routePrefix);
83 83
 
84
-        $parsedRoutes   =   [];
84
+        $parsedRoutes = [];
85 85
 
86 86
         if ($this->option('router') === 'laravel') {
87 87
             foreach ($routePrefixes as $routePrefix) {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 $parsedRoutes += $this->processDingoRoutes($generator, $allowedRoutes, $routePrefix, $middleware);
93 93
             }
94 94
         }
95
-        $parsedRoutes = collect($parsedRoutes)->groupBy('resource')->sort(function ($a, $b) {
95
+        $parsedRoutes = collect($parsedRoutes)->groupBy('resource')->sort(function($a, $b) {
96 96
             return strcmp($a->first()['resource'], $b->first()['resource']);
97 97
         });
98 98
 
@@ -107,15 +107,15 @@  discard block
 block discarded – undo
107 107
     private function writeMarkdown($parsedRoutes)
108 108
     {
109 109
         $outputPath = $this->option('output');
110
-        $targetFile = $outputPath.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'index.md';
111
-        $compareFile = $outputPath.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'.compare.md';
110
+        $targetFile = $outputPath . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . 'index.md';
111
+        $compareFile = $outputPath . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . '.compare.md';
112 112
 
113 113
         $infoText = view('apidoc::partials.info')
114 114
             ->with('outputPath', ltrim($outputPath, 'public/'))
115
-            ->with('showPostmanCollectionButton', ! $this->option('noPostmanCollection'));
115
+            ->with('showPostmanCollectionButton', !$this->option('noPostmanCollection'));
116 116
 
117
-        $parsedRouteOutput = $parsedRoutes->map(function ($routeGroup) {
118
-            return $routeGroup->map(function ($route) {
117
+        $parsedRouteOutput = $parsedRoutes->map(function($routeGroup) {
118
+            return $routeGroup->map(function($route) {
119 119
                 $route['output'] = (string) view('apidoc::partials.route')->with('parsedRoute', $route)->render();
120 120
 
121 121
                 return $route;
@@ -139,16 +139,16 @@  discard block
 block discarded – undo
139 139
                 $frontmatter = trim($generatedFrontmatter[1], "\n");
140 140
             }
141 141
 
142
-            $parsedRouteOutput->transform(function ($routeGroup) use ($generatedDocumentation, $compareDocumentation) {
143
-                return $routeGroup->transform(function ($route) use ($generatedDocumentation, $compareDocumentation) {
144
-                    if (preg_match('/<!-- START_'.$route['id'].' -->(.*)<!-- END_'.$route['id'].' -->/is', $generatedDocumentation, $routeMatch)) {
145
-                        $routeDocumentationChanged = (preg_match('/<!-- START_'.$route['id'].' -->(.*)<!-- END_'.$route['id'].' -->/is', $compareDocumentation, $compareMatch) && $compareMatch[1] !== $routeMatch[1]);
142
+            $parsedRouteOutput->transform(function($routeGroup) use ($generatedDocumentation, $compareDocumentation) {
143
+                return $routeGroup->transform(function($route) use ($generatedDocumentation, $compareDocumentation) {
144
+                    if (preg_match('/<!-- START_' . $route['id'] . ' -->(.*)<!-- END_' . $route['id'] . ' -->/is', $generatedDocumentation, $routeMatch)) {
145
+                        $routeDocumentationChanged = (preg_match('/<!-- START_' . $route['id'] . ' -->(.*)<!-- END_' . $route['id'] . ' -->/is', $compareDocumentation, $compareMatch) && $compareMatch[1] !== $routeMatch[1]);
146 146
                         if ($routeDocumentationChanged === false || $this->option('force')) {
147 147
                             if ($routeDocumentationChanged) {
148
-                                $this->warn('Discarded manual changes for route ['.implode(',', $route['methods']).'] '.$route['uri']);
148
+                                $this->warn('Discarded manual changes for route [' . implode(',', $route['methods']) . '] ' . $route['uri']);
149 149
                             }
150 150
                         } else {
151
-                            $this->warn('Skipping modified route ['.implode(',', $route['methods']).'] '.$route['uri']);
151
+                            $this->warn('Skipping modified route [' . implode(',', $route['methods']) . '] ' . $route['uri']);
152 152
                             $route['modified_output'] = $routeMatch[0];
153 153
                         }
154 154
                     }
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
             ->with('frontmatter', $frontmatter)
166 166
             ->with('infoText', $infoText)
167 167
             ->with('outputPath', $this->option('output'))
168
-            ->with('showPostmanCollectionButton', ! $this->option('noPostmanCollection'))
168
+            ->with('showPostmanCollectionButton', !$this->option('noPostmanCollection'))
169 169
             ->with('parsedRoutes', $parsedRouteOutput);
170 170
 
171
-        if (! is_dir($outputPath)) {
171
+        if (!is_dir($outputPath)) {
172 172
             $documentarian->create($outputPath);
173 173
         }
174 174
 
@@ -181,23 +181,23 @@  discard block
 block discarded – undo
181 181
             ->with('frontmatter', $frontmatter)
182 182
             ->with('infoText', $infoText)
183 183
             ->with('outputPath', $this->option('output'))
184
-            ->with('showPostmanCollectionButton', ! $this->option('noPostmanCollection'))
184
+            ->with('showPostmanCollectionButton', !$this->option('noPostmanCollection'))
185 185
             ->with('parsedRoutes', $parsedRouteOutput);
186 186
 
187 187
         file_put_contents($compareFile, $compareMarkdown);
188 188
 
189
-        $this->info('Wrote index.md to: '.$outputPath);
189
+        $this->info('Wrote index.md to: ' . $outputPath);
190 190
 
191 191
         $this->info('Generating API HTML code');
192 192
 
193 193
         $documentarian->generate($outputPath);
194 194
 
195
-        $this->info('Wrote HTML documentation to: '.$outputPath.'/public/index.html');
195
+        $this->info('Wrote HTML documentation to: ' . $outputPath . '/public/index.html');
196 196
 
197 197
         if ($this->option('noPostmanCollection') !== true) {
198 198
             $this->info('Generating Postman collection');
199 199
 
200
-            file_put_contents($outputPath.DIRECTORY_SEPARATOR.'collection.json', $this->generatePostmanCollection($parsedRoutes));
200
+            file_put_contents($outputPath . DIRECTORY_SEPARATOR . 'collection.json', $this->generatePostmanCollection($parsedRoutes));
201 201
         }
202 202
     }
203 203
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      */
226 226
     private function setUserToBeImpersonated($actAs)
227 227
     {
228
-        if (! empty($actAs)) {
228
+        if (!empty($actAs)) {
229 229
             if (version_compare($this->laravel->version(), '5.2.0', '<')) {
230 230
                 $userModel = config('auth.model');
231 231
                 $user = $userModel::find((int) $actAs);
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
             if (in_array($route->getName(), $allowedRoutes) || str_is($routePrefix, $generator->getUri($route)) || in_array($middleware, $route->middleware())) {
268 268
                 if ($this->isValidRoute($route) && $this->isRouteVisibleForDocumentation($route->getAction()['uses'])) {
269 269
                     $parsedRoutes[] = $generator->processRoute($route, $bindings, $this->option('header'), $withResponse);
270
-                    $this->info('Processed route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route));
270
+                    $this->info('Processed route: [' . implode(',', $generator->getMethods($route)) . '] ' . $generator->getUri($route));
271 271
                 } else {
272
-                    $this->warn('Skipping route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route));
272
+                    $this->warn('Skipping route: [' . implode(',', $generator->getMethods($route)) . '] ' . $generator->getUri($route));
273 273
                 }
274 274
             }
275 275
         }
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
             if (empty($allowedRoutes) || in_array($route->getName(), $allowedRoutes) || str_is($routePrefix, $route->uri()) || in_array($middleware, $route->middleware())) {
295 295
                 if ($this->isValidRoute($route) && $this->isRouteVisibleForDocumentation($route->getAction()['uses'])) {
296 296
                     $parsedRoutes[] = $generator->processRoute($route, $bindings, $this->option('header'), $withResponse);
297
-                    $this->info('Processed route: ['.implode(',', $route->getMethods()).'] '.$route->uri());
297
+                    $this->info('Processed route: [' . implode(',', $route->getMethods()) . '] ' . $route->uri());
298 298
                 } else {
299
-                    $this->warn('Skipping route: ['.implode(',', $route->getMethods()).'] '.$route->uri());
299
+                    $this->warn('Skipping route: [' . implode(',', $route->getMethods()) . '] ' . $route->uri());
300 300
                 }
301 301
             }
302 302
         }
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      */
312 312
     private function isValidRoute($route)
313 313
     {
314
-        return ! is_callable($route->getAction()['uses']) && ! is_null($route->getAction()['uses']);
314
+        return !is_callable($route->getAction()['uses']) && !is_null($route->getAction()['uses']);
315 315
     }
316 316
 
317 317
     /**
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
             $phpdoc = new DocBlock($comment);
329 329
 
330 330
             return collect($phpdoc->getTags())
331
-                ->filter(function ($tag) use ($route) {
331
+                ->filter(function($tag) use ($route) {
332 332
                     return $tag->getName() === 'hideFromAPIDocumentation';
333 333
                 })
334 334
                 ->isEmpty();
Please login to merge, or discard this patch.