You are here

private function AnnotationReader::getPropertyImports in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_annotation_discovery/lib/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 modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php
Gets the annotations applied to a property.

File

modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php, line 346

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