@@ -44,8 +44,8 @@ discard block |
||
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 |
||
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 | } |
@@ -11,7 +11,7 @@ |
||
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 | { |
@@ -53,7 +53,7 @@ discard block |
||
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 |
||
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 | { |
@@ -78,7 +78,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -61,7 +61,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -15,11 +15,11 @@ discard block |
||
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' => resource_path('lang/vendor/apidoc'), |
|
22 | + __DIR__ . '/../../resources/lang' => resource_path('lang/vendor/apidoc'), |
|
23 | 23 | ]); |
24 | 24 | } |
25 | 25 | |
@@ -30,10 +30,10 @@ discard block |
||
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 |