@@ -32,6 +32,9 @@ |
||
32 | 32 | $this->endpoints = $endpoints; |
33 | 33 | } |
34 | 34 | |
35 | + /** |
|
36 | + * @return string |
|
37 | + */ |
|
35 | 38 | public function render() |
36 | 39 | { |
37 | 40 | $host = $this->config->get('yaro.apidocs.blueprint.host'); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | |
51 | 51 | public function create(string $snapshotName = '', string $diskName = '') |
52 | 52 | { |
53 | - $snapshotName = $snapshotName ?: 'blueprint_'. date('Y-m-d_H-i-s'); |
|
53 | + $snapshotName = $snapshotName ?: 'blueprint_'.date('Y-m-d_H-i-s'); |
|
54 | 54 | $diskName = $diskName ?: $this->config->get('yaro.apidocs.blueprint.disc'); |
55 | 55 | |
56 | 56 | $disk = $this->getDisk($diskName); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * API Blueprint related data. |
31 | 31 | */ |
32 | - 'blueprint' => [ |
|
32 | + 'blueprint' => [ |
|
33 | 33 | |
34 | 34 | 'host' => null, |
35 | 35 | |
@@ -39,6 +39,6 @@ discard block |
||
39 | 39 | 'reference_delimiter' => ' / ', |
40 | 40 | 'disc' => 'apidocs', |
41 | 41 | |
42 | - ] |
|
42 | + ] |
|
43 | 43 | |
44 | 44 | ]; |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | public function boot() |
13 | 13 | { |
14 | 14 | $this->publishes([ |
15 | - __DIR__ . '/../config/apidocs.php' => config_path('yaro.apidocs.php'), |
|
15 | + __DIR__.'/../config/apidocs.php' => config_path('yaro.apidocs.php'), |
|
16 | 16 | ], 'config'); |
17 | 17 | |
18 | - $this->app['view']->addNamespace('apidocs', __DIR__ . '/../resources/views'); |
|
18 | + $this->app['view']->addNamespace('apidocs', __DIR__.'/../resources/views'); |
|
19 | 19 | |
20 | 20 | $this->app->bind('command.apidocs:blueprint-create', BlueprintCreate::class); |
21 | 21 | $this->commands([ |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | public function register() |
27 | 27 | { |
28 | - $configPath = __DIR__ . '/../config/apidocs.php'; |
|
28 | + $configPath = __DIR__.'/../config/apidocs.php'; |
|
29 | 29 | $this->mergeConfigFrom($configPath, 'yaro.apidocs'); |
30 | 30 | |
31 | 31 | $this->app->singleton('yaro.apidocs', function($app) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | private function isPrefixedRoute($route) |
76 | 76 | { |
77 | 77 | $prefix = $this->config->get('yaro.apidocs.prefix', 'api'); |
78 | - $regexp = '~^'. preg_quote($prefix) .'~'; |
|
78 | + $regexp = '~^'.preg_quote($prefix).'~'; |
|
79 | 79 | |
80 | 80 | return preg_match($regexp, $this->getRouteParam($route, 'uri')); |
81 | 81 | } // end isPrefixedRoute |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $checkForLongDescription = true; |
110 | 110 | foreach ($docs as $line) { |
111 | 111 | if ($checkForLongDescription && !preg_match('~^@\w+~', $line)) { |
112 | - $description .= trim($line) .' '; |
|
112 | + $description .= trim($line).' '; |
|
113 | 113 | } elseif (preg_match('~^@\w+~', $line)) { |
114 | 114 | $checkForLongDescription = false; |
115 | 115 | if (preg_match('~^@param~', $line)) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | ksort($endpoints); |
178 | 178 | |
179 | 179 | $sorted = array(); |
180 | - foreach($endpoints as $key => $val) { |
|
180 | + foreach ($endpoints as $key => $val) { |
|
181 | 181 | $this->ins($sorted, explode('.', $key), $val); |
182 | 182 | } |
183 | 183 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $httpMethod = $this->getRouteParam($route, 'methods.0'); |
198 | 198 | $classMethod = implode('-', $this->splitCamelCaseToWords($method)); |
199 | 199 | |
200 | - $hash = $path .'::'. $httpMethod .'::'. $classMethod; |
|
200 | + $hash = $path.'::'.$httpMethod.'::'.$classMethod; |
|
201 | 201 | |
202 | 202 | return strtolower($hash); |
203 | 203 | } // end generateHashForUrl |
@@ -230,8 +230,7 @@ discard block |
||
230 | 230 | private function ins(&$ary, $keys, $val) |
231 | 231 | { |
232 | 232 | $keys ? |
233 | - $this->ins($ary[array_shift($keys)], $keys, $val) : |
|
234 | - $ary = $val; |
|
233 | + $this->ins($ary[array_shift($keys)], $keys, $val) : $ary = $val; |
|
235 | 234 | } // end ins |
236 | 235 | |
237 | 236 | } |