public function CachedReader::getMethodAnnotations

Get method annotations

Parameters

\ReflectionMethod $method:

Return value

array

Overrides Reader::getMethodAnnotations

1 call to CachedReader::getMethodAnnotations()
CachedReader::getMethodAnnotation in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php
Get selected method annotation

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php, line 158

Class

CachedReader
A cache aware annotation reader.

Namespace

Doctrine\Common\Annotations

Code

public function getMethodAnnotations(\ReflectionMethod $method) {
  $class = $method
    ->getDeclaringClass();
  $cacheKey = $class
    ->getName() . '#' . $method
    ->getName();
  if (isset($this->loadedAnnotations[$cacheKey])) {
    return $this->loadedAnnotations[$cacheKey];
  }
  if (false === ($annots = $this
    ->fetchFromCache($cacheKey, $class))) {
    $annots = $this->delegate
      ->getMethodAnnotations($method);
    $this
      ->saveToCache($cacheKey, $annots);
  }
  return $this->loadedAnnotations[$cacheKey] = $annots;
}