Completed
Push — master ( 6aa3b5...49976f )
by Marcel
02:48
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/Generators/LaravelGenerator.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
     /**
13 13
      * @param Route $route
14
-     * @return mixed
14
+     * @return string
15 15
      */
16 16
     protected function getUri(Route $route)
17 17
     {
Please login to merge, or discard this patch.
src/Mpociot/ApiDoc/Generators/AbstractGenerator.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     }
54 54
 
55 55
     /**
56
-     * @param  $route
56
+     * @param  \Illuminate\Routing\Route $route
57 57
      *
58 58
      * @return \Illuminate\Http\Response
59 59
      */
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
      * @param  string  $rule
411 411
      * @param  string  $parameter
412 412
      *
413
-     * @return array
413
+     * @return string
414 414
      */
415 415
     protected function parseParameters($rule, $parameter)
416 416
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $uri = $this->getUri($route);
80 80
         foreach ($bindings as $model => $id) {
81
-            $uri = str_replace('{'.$model.'}', $id, $uri);
81
+            $uri = str_replace('{' . $model . '}', $id, $uri);
82 82
         }
83 83
 
84 84
         return $uri;
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
         foreach ($reflectionMethod->getParameters() as $parameter) {
141 141
             $parameterType = $parameter->getClass();
142
-            if (! is_null($parameterType) && class_exists($parameterType->name)) {
142
+            if (!is_null($parameterType) && class_exists($parameterType->name)) {
143 143
                 $className = $parameterType->name;
144 144
                 $parameterReflection = new $className;
145 145
                 if ($parameterReflection instanceof FormRequest) {
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
      */
165 165
     protected function fancyImplode($arr, $first, $last)
166 166
     {
167
-        $arr = array_map(function ($value) {
168
-            return '`'.$value.'`';
167
+        $arr = array_map(function($value) {
168
+            return '`' . $value . '`';
169 169
         }, $arr);
170 170
         array_push($arr, implode($last, array_splice($arr, -2)));
171 171
 
@@ -375,8 +375,8 @@  discard block
 block discarded – undo
375 375
         foreach ($headers as $name => $value) {
376 376
             $name = strtr(strtoupper($name), '-', '_');
377 377
 
378
-            if (! Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') {
379
-                $name = $prefix.$name;
378
+            if (!Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') {
379
+                $name = $prefix . $name;
380 380
             }
381 381
 
382 382
             $server[$name] = $value;
Please login to merge, or discard this patch.
src/Mpociot/ApiDoc/Commands/GenerateDocumentation.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         $this->setUserToBeImpersonated($this->option('actAsUserId'));
63 63
 
64
-        if ($routePrefix === null && ! count($allowedRoutes)) {
64
+        if ($routePrefix === null && !count($allowedRoutes)) {
65 65
             $this->error('You must provide either a route prefix or a route to generate the documentation.');
66 66
 
67 67
             return false;
@@ -90,19 +90,19 @@  discard block
 block discarded – undo
90 90
 
91 91
         $markdown = view('apidoc::documentarian')->with('parsedRoutes', $parsedRoutes->all());
92 92
 
93
-        if (! is_dir($outputPath)) {
93
+        if (!is_dir($outputPath)) {
94 94
             $documentarian->create($outputPath);
95 95
         }
96 96
 
97
-        file_put_contents($outputPath.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'index.md', $markdown);
97
+        file_put_contents($outputPath . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR . 'index.md', $markdown);
98 98
 
99
-        $this->info('Wrote index.md to: '.$outputPath);
99
+        $this->info('Wrote index.md to: ' . $outputPath);
100 100
 
101 101
         $this->info('Generating API HTML code');
102 102
 
103 103
         $documentarian->generate($outputPath);
104 104
 
105
-        $this->info('Wrote HTML documentation to: '.$outputPath.'/public/index.html');
105
+        $this->info('Wrote HTML documentation to: ' . $outputPath . '/public/index.html');
106 106
     }
107 107
 
108 108
     /**
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      */
130 130
     private function setUserToBeImpersonated($actAs)
131 131
     {
132
-        if (! empty($actAs)) {
132
+        if (!empty($actAs)) {
133 133
             if (version_compare($this->laravel->version(), '5.2.0', '<')) {
134 134
                 $userModel = config('auth.model');
135 135
                 $user = $userModel::find($actAs);
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
             if (in_array($route->getName(), $allowedRoutes) || str_is($routePrefix, $route->getUri())) {
171 171
                 if ($this->isValidRoute($route)) {
172 172
                     $parsedRoutes[] = $generator->processRoute($route, $bindings);
173
-                    $this->info('Processed route: '.$route->getUri());
173
+                    $this->info('Processed route: ' . $route->getUri());
174 174
                 } else {
175
-                    $this->warn('Skipping route: '.$route->getUri().' - contains closure.');
175
+                    $this->warn('Skipping route: ' . $route->getUri() . ' - contains closure.');
176 176
                 }
177 177
             }
178 178
         }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         foreach ($routes as $route) {
196 196
             if (empty($allowedRoutes) || in_array($route->getName(), $allowedRoutes) || str_is($routePrefix, $route->uri())) {
197 197
                 $parsedRoutes[] = $generator->processRoute($route, $bindings);
198
-                $this->info('Processed route: '.$route->uri());
198
+                $this->info('Processed route: ' . $route->uri());
199 199
             }
200 200
         }
201 201
 
@@ -209,6 +209,6 @@  discard block
 block discarded – undo
209 209
      */
210 210
     private function isValidRoute($route)
211 211
     {
212
-        return ! is_callable($route->getAction()['uses']);
212
+        return !is_callable($route->getAction()['uses']);
213 213
     }
214 214
 }
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   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  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'),
22
+            __DIR__ . '/../../resources/lang' => $this->resource_path('lang/vendor/apidoc'),
23 23
         ]);
24 24
     }
25 25
 
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function register()
32 32
     {
33
-        $this->app['apidoc.generate'] = $this->app->share(function () {
33
+        $this->app['apidoc.generate'] = $this->app->share(function() {
34 34
             return new GenerateDocumentation();
35 35
         });
36
-        $this->app['apidoc.update'] = $this->app->share(function () {
36
+        $this->app['apidoc.update'] = $this->app->share(function() {
37 37
             return new UpdateDocumentation();
38 38
         });
39 39
 
@@ -52,6 +52,6 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function resource_path($path = '')
54 54
     {
55
-        return app()->basePath().'/resources'.($path ? '/'.$path : $path);
55
+        return app()->basePath() . '/resources' . ($path ? '/' . $path : $path);
56 56
     }
57 57
 }
Please login to merge, or discard this patch.