Merge pull request #851 from blitzr/master

Allow custom ApiDoc annotation
This commit is contained in:
William Durand 2016-05-16 21:08:35 +02:00
commit a7ad7ff144

View File

@ -122,7 +122,7 @@ class ApiDocExtractor
}
if ($method = $this->getReflectionMethod($route->getDefault('_controller'))) {
$annotation = $this->reader->getMethodAnnotation($method, self::ANNOTATION_CLASS);
$annotation = $this->reader->getMethodAnnotation($method, static::ANNOTATION_CLASS);
if (
$annotation && !in_array($annotation->getSection(), $excludeSections) &&
(in_array($view, $annotation->getViews()) || (0 === count($annotation->getViews()) && $view === ApiDoc::DEFAULT_VIEW))
@ -255,7 +255,7 @@ class ApiDocExtractor
public function get($controller, $route)
{
if ($method = $this->getReflectionMethod($controller)) {
if ($annotation = $this->reader->getMethodAnnotation($method, self::ANNOTATION_CLASS)) {
if ($annotation = $this->reader->getMethodAnnotation($method, static::ANNOTATION_CLASS)) {
if ($route = $this->router->getRouteCollection()->get($route)) {
return $this->extractData($annotation, $route, $method);
}