@@ -70,7 +70,7 @@ discard block |
||
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,23 +101,23 @@ discard block |
||
101 | 101 | $routePath = $generator->getUri($route); |
102 | 102 | |
103 | 103 | if ($this->isClosureRoute($route->getAction())) { |
104 | - $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).': Closure routes are not supported.'); |
|
104 | + $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . ': Closure routes are not supported.'); |
|
105 | 105 | continue; |
106 | 106 | } |
107 | 107 | |
108 | 108 | $routeControllerAndMethod = Utils::getRouteClassAndMethodNames($route->getAction()); |
109 | - if (! $this->isValidRoute($routeControllerAndMethod)) { |
|
109 | + if (!$this->isValidRoute($routeControllerAndMethod)) { |
|
110 | 110 | $this->warn(sprintf($messageFormat, 'Skipping invalid', $routeMethods, $routePath)); |
111 | 111 | continue; |
112 | 112 | } |
113 | 113 | |
114 | - if (! $this->doesControllerMethodExist($routeControllerAndMethod)) { |
|
115 | - $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).': Controller method does not exist.'); |
|
114 | + if (!$this->doesControllerMethodExist($routeControllerAndMethod)) { |
|
115 | + $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . ': Controller method does not exist.'); |
|
116 | 116 | continue; |
117 | 117 | } |
118 | 118 | |
119 | - if (! $this->isRouteVisibleForDocumentation($routeControllerAndMethod)) { |
|
120 | - $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).': @hideFromAPIDocumentation was specified.'); |
|
119 | + if (!$this->isRouteVisibleForDocumentation($routeControllerAndMethod)) { |
|
120 | + $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . ': @hideFromAPIDocumentation was specified.'); |
|
121 | 121 | continue; |
122 | 122 | } |
123 | 123 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $parsedRoutes[] = $generator->processRoute($route, $routeItem->getRules()); |
126 | 126 | $this->info(sprintf($messageFormat, 'Processed', $routeMethods, $routePath)); |
127 | 127 | } catch (\Exception $exception) { |
128 | - $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).'- Exception '.get_class($exception).' encountered : '.$exception->getMessage()); |
|
128 | + $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . '- Exception ' . get_class($exception) . ' encountered : ' . $exception->getMessage()); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $routeControllerAndMethod = implode('@', $routeControllerAndMethod); |
144 | 144 | } |
145 | 145 | |
146 | - return ! is_callable($routeControllerAndMethod) && ! is_null($routeControllerAndMethod); |
|
146 | + return !is_callable($routeControllerAndMethod) && !is_null($routeControllerAndMethod); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | [$class, $method] = $routeControllerAndMethod; |
170 | 170 | $reflection = new ReflectionClass($class); |
171 | 171 | |
172 | - if (! $reflection->hasMethod($method)) { |
|
172 | + if (!$reflection->hasMethod($method)) { |
|
173 | 173 | return false; |
174 | 174 | } |
175 | 175 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $phpdoc = new DocBlock($comment); |
195 | 195 | |
196 | 196 | return collect($phpdoc->getTags()) |
197 | - ->filter(function ($tag) { |
|
197 | + ->filter(function($tag) { |
|
198 | 198 | return $tag->getName() === 'hideFromAPIDocumentation'; |
199 | 199 | }) |
200 | 200 | ->isEmpty(); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $method = $controller->getMethod($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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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) { |