Completed
Pull Request — master (#690)
by
unknown
02:14 queued 52s
created
src/Extracting/Generator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $method = Utils::reflectRouteMethod([$controllerName, $methodName]);
59 59
 
60 60
         $parsedRoute = [
61
-            'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))),
61
+            'id' => md5($this->getUri($route) . ':' . implode($this->getMethods($route))),
62 62
             'methods' => $this->getMethods($route),
63 63
             'uri' => $this->getUri($route),
64 64
         ];
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $responses = $this->fetchResponses($controller, $method, $route, $routeRules, $parsedRoute);
85 85
         $parsedRoute['responses'] = $responses;
86
-        $parsedRoute['showresponse'] = ! empty($responses);
86
+        $parsedRoute['showresponse'] = !empty($responses);
87 87
 
88 88
         return $parsedRoute;
89 89
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $responses = $this->iterateThroughStrategies('responses', $context, [$route, $controller, $method, $rulesToApply]);
122 122
         if (count($responses)) {
123
-            return array_filter($responses, function ($response) {
123
+            return array_filter($responses, function($response) {
124 124
                 return $response['content'] != null;
125 125
             });
126 126
         }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             $strategyArgs = $arguments;
171 171
             $strategyArgs[] = $context;
172 172
             $results = $strategy(...$strategyArgs);
173
-            if (! is_null($results)) {
173
+            if (!is_null($results)) {
174 174
                 foreach ($results as $index => $item) {
175 175
                     if ($stage == 'responses') {
176 176
                         // Responses are additive
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                     // and also allows values to be overwritten
183 183
 
184 184
                     // Don't allow overwriting if an empty value is trying to replace a set one
185
-                    if (! in_array($context[$stage], [null, ''], true) && in_array($item, [null, ''], true)) {
185
+                    if (!in_array($context[$stage], [null, ''], true) && in_array($item, [null, ''], true)) {
186 186
                         continue;
187 187
                     } else {
188 188
                         $context[$stage][$index] = $item;
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
         $values = [];
208 208
 
209 209
         // Remove params which have no examples.
210
-        $params = array_filter($params, function ($details) {
211
-            return ! is_null($details['value']);
210
+        $params = array_filter($params, function($details) {
211
+            return !is_null($details['value']);
212 212
         });
213 213
 
214 214
         foreach ($params as $paramName => $details) {
Please login to merge, or discard this patch.
src/Commands/GenerateDocumentation.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         $groupedRoutes = collect($parsedRoutes)
72 72
             ->groupBy('metadata.groupName')
73
-            ->sortBy(static function ($group) {
73
+            ->sortBy(static function($group) {
74 74
                 /* @var $group Collection */
75 75
                 return $group->first()['metadata']['groupName'];
76 76
             }, SORT_NATURAL);
@@ -101,18 +101,18 @@  discard block
 block discarded – undo
101 101
             $routePath = $generator->getUri($route);
102 102
 
103 103
             $routeControllerAndMethod = Utils::getRouteClassAndMethodNames($route->getAction());
104
-            if (! $this->isValidRoute($routeControllerAndMethod)) {
104
+            if (!$this->isValidRoute($routeControllerAndMethod)) {
105 105
                 $this->warn(sprintf($messageFormat, 'Skipping invalid', $routeMethods, $routePath));
106 106
                 continue;
107 107
             }
108 108
 
109
-            if (! $this->doesControllerMethodExist($routeControllerAndMethod)) {
110
-                $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).': Controller method does not exist.');
109
+            if (!$this->doesControllerMethodExist($routeControllerAndMethod)) {
110
+                $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . ': Controller method does not exist.');
111 111
                 continue;
112 112
             }
113 113
 
114
-            if (! $this->isRouteVisibleForDocumentation($routeControllerAndMethod)) {
115
-                $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).': @hideFromAPIDocumentation was specified.');
114
+            if (!$this->isRouteVisibleForDocumentation($routeControllerAndMethod)) {
115
+                $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . ': @hideFromAPIDocumentation was specified.');
116 116
                 continue;
117 117
             }
118 118
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                 $parsedRoutes[] = $generator->processRoute($route, $routeItem->getRules());
121 121
                 $this->info(sprintf($messageFormat, 'Processed', $routeMethods, $routePath));
122 122
             } catch (\Exception $exception) {
123
-                $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).'- Exception '.get_class($exception).' encountered : '.$exception->getMessage());
123
+                $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . '- Exception ' . get_class($exception) . ' encountered : ' . $exception->getMessage());
124 124
             }
125 125
         }
126 126
 
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
             if (Utils::isInvokableObject($classOrObject)) {
140 140
                 return true;
141 141
             }
142
-            $routeControllerAndMethod = $classOrObject.'@'.$method;
142
+            $routeControllerAndMethod = $classOrObject . '@' . $method;
143 143
         }
144 144
 
145
-        return ! is_callable($routeControllerAndMethod) && ! is_null($routeControllerAndMethod);
145
+        return !is_callable($routeControllerAndMethod) && !is_null($routeControllerAndMethod);
146 146
     }
147 147
 
148 148
     /**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         [$class, $method] = $routeControllerAndMethod;
158 158
         $reflection = new ReflectionClass($class);
159 159
 
160
-        if (! $reflection->hasMethod($method)) {
160
+        if (!$reflection->hasMethod($method)) {
161 161
             return false;
162 162
         }
163 163
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             $phpdoc = new DocBlock($comment);
180 180
 
181 181
             return collect($phpdoc->getTags())
182
-                ->filter(function ($tag) {
182
+                ->filter(function($tag) {
183 183
                     return $tag->getName() === 'hideFromAPIDocumentation';
184 184
                 })
185 185
                 ->isEmpty();
Please login to merge, or discard this patch.