/** * Returns the ReflectionMethod for the given controller string. * * @param string $controller *Â @return \ReflectionMethod|null */ public function getReflectionMethod($controller) { if (false === strpos($controller, '::') && 2 === substr_count($controller, ':')) { $controller = $this->controllerNameParser->parse($controller); } if (preg_match('#(.+)::([\\w]+)#', $controller, $matches)) { $class = $matches[1]; $method = $matches[2]; } elseif (preg_match('#(.+):([\\w]+)#', $controller, $matches)) { $controller = $matches[1]; $method = $matches[2]; if ($this->container->has($controller)) { $this->container->enterScope('request'); $this->container->set('request', new Request(), 'request'); $class = ClassUtils::getRealClass(get_class($this->container->get($controller))); $this->container->leaveScope('request'); } } if (isset($class) && isset($method)) { try { return new \ReflectionMethod($class, $method); } catch (\ReflectionException $e) { } } return null; }