private function AnnotationReader::getPropertyImports in Plug 7
Retrieves imports for properties.
Parameters
\ReflectionProperty $property:
Return value
array
1 call to AnnotationReader::getPropertyImports()
- AnnotationReader::getPropertyAnnotations in lib/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ AnnotationReader.php - Gets the annotations applied to a property.
File
- lib/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ AnnotationReader.php, line 347
Class
- AnnotationReader
- A reader for docblock annotations.
Namespace
Doctrine\Common\AnnotationsCode
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);
}