You are here

public function AnnotationReader::getMethodAnnotation 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::getMethodAnnotation()

Gets a method annotation.

Parameters

\ReflectionMethod $method The ReflectionMethod to read the annotations from.:

string $annotationName The name of the annotation.:

Return value

object|null The Annotation or NULL, if the requested annotation does not exist.

Overrides Reader::getMethodAnnotation

File

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

Class

AnnotationReader
A reader for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

public function getMethodAnnotation(ReflectionMethod $method, $annotationName) {
  $annotations = $this
    ->getMethodAnnotations($method);
  foreach ($annotations as $annotation) {
    if ($annotation instanceof $annotationName) {
      return $annotation;
    }
  }
  return null;
}