Completed
Push — master ( 259dc4...38eb66 )
by Yaro
01:36
created
src/ApiDocs.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -179,6 +179,9 @@  discard block
 block discarded – undo
179 179
         return isset($matches[1]) ? $matches[1] : [];
180 180
     } // end getUriParams
181 181
     
182
+    /**
183
+     * @param string $key
184
+     */
182 185
     private function generateHashForUrl($key, $route, $method)
183 186
     {
184 187
         $path = preg_replace('~\s+~', '-', $key);
@@ -203,6 +206,9 @@  discard block
 block discarded – undo
203 206
         return preg_split($splitCamelCaseRegexp, $chunk);
204 207
     } // end splitCamelCaseToWords
205 208
     
209
+    /**
210
+     * @param string $param
211
+     */
206 212
     private function getRouteParam($route, $param)
207 213
     {
208 214
         $route = (array) $route;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     
114 114
     private function isPrefixedRoute($route, $routePrefix)
115 115
     {
116
-        $regexp = '~^'. preg_quote($routePrefix) .'~';
116
+        $regexp = '~^'.preg_quote($routePrefix).'~';
117 117
         
118 118
         return preg_match($regexp, $this->getRouteParam($route, 'uri'));
119 119
     } // end isPrefixedRoute
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         $checkForLongDescription = true;
166 166
         foreach ($docs as $line) {
167 167
             if ($checkForLongDescription && !preg_match('~^@\w+~', $line)) {
168
-                $description .= trim($line) .' ';
168
+                $description .= trim($line).' ';
169 169
             } elseif (preg_match('~^@\w+~', $line)) {
170 170
                 $checkForLongDescription = false;
171 171
                 if (preg_match('~^@param~', $line)) {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
         // TODO:
187 187
         $rules = [];
188
-        foreach($reflectorMethod->getParameters() as $reflectorParam) {
188
+        foreach ($reflectorMethod->getParameters() as $reflectorParam) {
189 189
             $paramClass = $reflectorParam->getClass();
190 190
             if ($paramClass instanceof ReflectionClass) {
191 191
                 $name = $paramClass->getName();
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         $httpMethod = $this->getRouteParam($route, 'methods.0');
298 298
         $classMethod = implode('-', $this->splitCamelCaseToWords($method));
299 299
         
300
-        $hash = $path .'::'. $httpMethod .'::'. $classMethod;
300
+        $hash = $path.'::'.$httpMethod.'::'.$classMethod;
301 301
         
302 302
         return strtolower($hash);
303 303
     } // end generateHashForUrl
@@ -330,8 +330,7 @@  discard block
 block discarded – undo
330 330
     private function ins(&$ary, $keys, $val) 
331 331
     {
332 332
         $keys ? 
333
-            $this->ins($ary[array_shift($keys)], $keys, $val) :
334
-            $ary = $val;
333
+            $this->ins($ary[array_shift($keys)], $keys, $val) : $ary = $val;
335 334
     } // end ins
336 335
     
337 336
     private function arrayGet($array, $key, $default = null)
@@ -345,7 +344,7 @@  discard block
 block discarded – undo
345 344
         }
346 345
         
347 346
         foreach (explode('.', $key) as $segment) {
348
-            if (!is_array($array) || ! array_key_exists($segment, $array)) {
347
+            if (!is_array($array) || !array_key_exists($segment, $array)) {
349 348
                 return $default;
350 349
             }
351 350
             $array = $array[$segment];
Please login to merge, or discard this patch.
src/Blueprint.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -32,6 +32,9 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
config/apidocs.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     /**
25 25
      * Exclude specific routes from documentation. Asterisks may be used to indicate wildcards.
26 26
      */
27
-     'exclude' => [
27
+        'exclude' => [
28 28
         'classes' => [
29 29
             // 'App\Http\Controllers\*' - exclude all controllers from docs.
30 30
             // 'App\Http\Controllers\MyController@*' - remove all methods for specific controller from docs.
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             // 'payment/test',
35 35
             // 'simulate/*',
36 36
         ],
37
-     ],
37
+        ],
38 38
     
39 39
     /**
40 40
      * Image src for logo.
Please login to merge, or discard this patch.