diff --git a/Describer/SwaggerPhpDescriber.php b/Describer/SwaggerPhpDescriber.php index 956bc53b1..d9f64a5e4 100644 --- a/Describer/SwaggerPhpDescriber.php +++ b/Describer/SwaggerPhpDescriber.php @@ -229,8 +229,7 @@ private function getMethodsToParse(): \Generator } $controller = $route->getDefault('_controller'); - if ($callable = $this->controllerReflector->getReflectionClassAndMethod($controller)) { - list($class, $method) = $callable; + if ($method = $this->controllerReflector->getReflectionMethod($controller)) { $path = $this->normalizePath($route->getPath()); $httpMethods = $route->getMethods() ?: Swagger::$METHODS; $httpMethods = array_map('strtolower', $httpMethods); diff --git a/Util/ControllerReflector.php b/Util/ControllerReflector.php index 3f2788735..4b4fcb1a6 100644 --- a/Util/ControllerReflector.php +++ b/Util/ControllerReflector.php @@ -59,23 +59,6 @@ public function getReflectionMethod(string $controller) } } - public function getReflectionClassAndMethod(string $controller) - { - $callable = $this->getClassAndMethod($controller); - if (null === $callable) { - return; - } - - list($class, $method) = $callable; - - try { - return [new \ReflectionClass($class), new \ReflectionMethod($class, $method)]; - } catch (\ReflectionException $e) { - // In case we can't reflect the controller, we just - // ignore the route - } - } - private function getClassAndMethod(string $controller) { if (isset($this->controllers[$controller])) {