You are here

public function FileCacheReader::getMethodAnnotation in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php \Doctrine\Common\Annotations\FileCacheReader::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

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php, line 250

Class

FileCacheReader
File cache reader for 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;
}