PartKeepr\ApiDocBundle\Extractor\ApiDocExtractor::parseAnnotations PHP Method

parseAnnotations() protected method

This method has been adjusted so that it can read annotations from the parent class.
protected parseAnnotations ( Nelmio\ApiDocBundle\Annotation\ApiDoc $annotation, Symfony\Component\Routing\Route $route, ReflectionMethod $method )
$annotation Nelmio\ApiDocBundle\Annotation\ApiDoc
$route Symfony\Component\Routing\Route
$method ReflectionMethod
    protected function parseAnnotations(ApiDoc $annotation, Route $route, \ReflectionMethod $method)
    {
        $classAnnotations = $this->reader->getMethodAnnotations($method);
        $declaringClass = $method->getDeclaringClass();
        $parentClass = $declaringClass->getParentClass();
        $parentAnnotations = [];
        if ($parentClass && $parentClass->hasMethod($method->getShortName())) {
            $parentMethod = $parentClass->getMethod($method->getShortName());
            $parentAnnotations = $this->reader->getMethodAnnotations($parentMethod);
        }
        $allAnnotations = array_merge($classAnnotations, $parentAnnotations);
        foreach ($this->handlers as $handler) {
            $handler->handle($annotation, $allAnnotations, $route, $method);
        }
    }
ApiDocExtractor