mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Return early in case of wrong controller pattern
This commit is contained in:
parent
2791512139
commit
15d56360f3
@ -113,7 +113,10 @@ class ApiDocExtractor
|
||||
*/
|
||||
public function get($controller, $route)
|
||||
{
|
||||
preg_match('#(.+)::([\w]+)#', $controller, $matches);
|
||||
if (!preg_match('#(.+)::([\w]+)#', $controller, $matches)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$method = new \ReflectionMethod($matches[1], $matches[2]);
|
||||
|
||||
if ($annot = $this->reader->getMethodAnnotation($method, self::ANNOTATION_CLASS)) {
|
||||
@ -121,7 +124,5 @@ class ApiDocExtractor
|
||||
return array('annotation' => $annot, 'route' => $route);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user