You are here

private function AnnotationReader::getPropertyImports in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php \Doctrine\Common\Annotations\AnnotationReader::getPropertyImports()

Retrieves imports for properties.

Parameters

\ReflectionProperty $property:

Return value

array

1 call to AnnotationReader::getPropertyImports()
AnnotationReader::getPropertyAnnotations in vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php
Gets the annotations applied to a property.

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php, line 347

Class

AnnotationReader
A reader for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

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);
}