function AnnotationReader::getFunctionAnnotation
Gets a function annotation.
Return value
object|null The Annotation or NULL, if the requested annotation does not exist.
File
-
vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ AnnotationReader.php, line 254
Class
- AnnotationReader
- A reader for docblock annotations.
Namespace
Doctrine\Common\AnnotationsCode
public function getFunctionAnnotation(ReflectionFunction $function, string $annotationName) {
$annotations = $this->getFunctionAnnotations($function);
foreach ($annotations as $annotation) {
if ($annotation instanceof $annotationName) {
return $annotation;
}
}
return null;
}