public function AnnotationReader::getMethodAnnotation

Gets a method annotation.

Parameters

ReflectionMethod $method:

string $annotationName The name of the annotation.:

Return value

mixed The Annotation or NULL, if the requested annotation does not exist.

Overrides Reader::getMethodAnnotation

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php, line 239

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