private function AnnotationReader::getMethodImports in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php \Doctrine\Common\Annotations\AnnotationReader::getMethodImports()
Retrieves imports for methods.
Parameters
\ReflectionMethod $method:
Return value
array
1 call to AnnotationReader::getMethodImports()
- AnnotationReader::getMethodAnnotations in modules/
providers/ service_container_annotation_discovery/ lib/ Doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ AnnotationReader.php - Gets the annotations applied to a method.
File
- modules/
providers/ service_container_annotation_discovery/ lib/ Doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ AnnotationReader.php, line 318
Class
- AnnotationReader
- A reader for docblock annotations.
Namespace
Doctrine\Common\AnnotationsCode
private function getMethodImports(ReflectionMethod $method) {
$class = $method
->getDeclaringClass();
$classImports = $this
->getClassImports($class);
if (!method_exists($class, 'getTraits')) {
return $classImports;
}
$traitImports = array();
foreach ($class
->getTraits() as $trait) {
if ($trait
->hasMethod($method
->getName()) && $trait
->getFileName() === $method
->getFileName()) {
$traitImports = array_merge($traitImports, $this->phpParser
->parseClass($trait));
}
}
return array_merge($classImports, $traitImports);
}