@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $class = new ReflectionClass($className); |
| 39 | 39 | |
| 40 | - if (! $class->hasMethod($methodName)) { |
|
| 40 | + if (!$class->hasMethod($methodName)) { |
|
| 41 | 41 | throw new \Exception("Error while fetching docblock for route: Class $className does not contain method $methodName"); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | if (is_object($classNameOrInstance)) { |
| 65 | 65 | // route handlers are not destroyed until the script |
| 66 | 66 | // ends so this should be perfectly safe. |
| 67 | - $classNameOrInstance = get_class($classNameOrInstance).'::'.spl_object_id($classNameOrInstance); |
|
| 67 | + $classNameOrInstance = get_class($classNameOrInstance) . '::' . spl_object_id($classNameOrInstance); |
|
| 68 | 68 | } |
| 69 | 69 | return $classNameOrInstance; |
| 70 | 70 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $groupedRoutes = collect($parsedRoutes) |
| 73 | 73 | ->groupBy('metadata.groupName') |
| 74 | - ->sortBy(static function ($group) { |
|
| 74 | + ->sortBy(static function($group) { |
|
| 75 | 75 | /* @var $group Collection */ |
| 76 | 76 | return $group->first()['metadata']['groupName']; |
| 77 | 77 | }, SORT_NATURAL); |
@@ -102,18 +102,18 @@ discard block |
||
| 102 | 102 | $routePath = $generator->getUri($route); |
| 103 | 103 | |
| 104 | 104 | $routeControllerAndMethod = Utils::getRouteClassAndMethodNames($route->getAction()); |
| 105 | - if (! $this->isValidRoute($routeControllerAndMethod)) { |
|
| 105 | + if (!$this->isValidRoute($routeControllerAndMethod)) { |
|
| 106 | 106 | $this->warn(sprintf($messageFormat, 'Skipping invalid', $routeMethods, $routePath)); |
| 107 | 107 | continue; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if (! $this->doesControllerMethodExist($routeControllerAndMethod)) { |
|
| 111 | - $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).': Controller method does not exist.'); |
|
| 110 | + if (!$this->doesControllerMethodExist($routeControllerAndMethod)) { |
|
| 111 | + $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . ': Controller method does not exist.'); |
|
| 112 | 112 | continue; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - if (! $this->isRouteVisibleForDocumentation($routeControllerAndMethod)) { |
|
| 116 | - $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).': @hideFromAPIDocumentation was specified.'); |
|
| 115 | + if (!$this->isRouteVisibleForDocumentation($routeControllerAndMethod)) { |
|
| 116 | + $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . ': @hideFromAPIDocumentation was specified.'); |
|
| 117 | 117 | continue; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $parsedRoutes[] = $generator->processRoute($route, $routeItem->getRules()); |
| 122 | 122 | $this->info(sprintf($messageFormat, 'Processed', $routeMethods, $routePath)); |
| 123 | 123 | } catch (\Exception $exception) { |
| 124 | - $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath).'- Exception '.get_class($exception).' encountered : '.$exception->getMessage()); |
|
| 124 | + $this->warn(sprintf($messageFormat, 'Skipping', $routeMethods, $routePath) . '- Exception ' . get_class($exception) . ' encountered : ' . $exception->getMessage()); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
@@ -140,10 +140,10 @@ discard block |
||
| 140 | 140 | if (Utils::isInvokableObject($classOrObject)) { |
| 141 | 141 | return true; |
| 142 | 142 | } |
| 143 | - $routeControllerAndMethod = $classOrObject.'@'.$method; |
|
| 143 | + $routeControllerAndMethod = $classOrObject . '@' . $method; |
|
| 144 | 144 | } |
| 145 | - return ! is_callable($routeControllerAndMethod) |
|
| 146 | - && ! is_null($routeControllerAndMethod); |
|
| 145 | + return !is_callable($routeControllerAndMethod) |
|
| 146 | + && !is_null($routeControllerAndMethod); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $phpdoc = new DocBlock($comment); |
| 182 | 182 | |
| 183 | 183 | return collect($phpdoc->getTags()) |
| 184 | - ->filter(function ($tag) { |
|
| 184 | + ->filter(function($tag) { |
|
| 185 | 185 | return $tag->getName() === 'hideFromAPIDocumentation'; |
| 186 | 186 | }) |
| 187 | 187 | ->isEmpty(); |