Doctrine\Common\Annotations\AnnotationReader::getPropertyImports PHP Method

getPropertyImports() private method

Retrieves imports for properties.
private getPropertyImports ( ReflectionProperty $property ) : array
$property ReflectionProperty
return array
    private function getPropertyImports(ReflectionProperty $property)
    {
        $class = $property->getDeclaringClass();
        $classImports = $this->getClassImports($class);
        if (!method_exists($class, 'getTraits')) {
            return $classImports;
        }
        $traitImports = array();
        foreach ($class->getTraits() as $trait) {
            if ($trait->hasProperty($property->getName())) {
                $traitImports = array_merge($traitImports, $this->phpParser->parseClass($trait));
            }
        }
        return array_merge($classImports, $traitImports);
    }