Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function getMethodAnnotations(\ReflectionMethod $method)
 {
     $annotations = array();
     foreach ($this->delegate->getMethodAnnotations($method) as $annot) {
         $annotations[get_class($annot)] = $annot;
     }
     return $annotations;
 }
 public function getMethodAnnotations(\ReflectionMethod $method)
 {
     $class = $method->getDeclaringClass();
     $key = $class->getName() . '#' . $method->getName();
     if (isset($this->loadedAnnotations[$key])) {
         return $this->loadedAnnotations[$key];
     }
     $path = $this->dir . '/' . strtr($key, '\\', '-') . '.cache.php';
     if (!file_exists($path)) {
         $annot = $this->reader->getMethodAnnotations($method);
         $this->saveCacheFile($path, $annot);
         return $this->loadedAnnotations[$key] = $annot;
     }
     if ($this->debug && false !== ($filename = $class->getFilename()) && filemtime($path) < filemtime($filename)) {
         unlink($path);
         $annot = $this->reader->getMethodAnnotations($method);
         $this->saveCacheFile($path, $annot);
         return $this->loadedAnnotations[$key] = $annot;
     }
     return $this->loadedAnnotations[$key] = (include $path);
 }