Ejemplo n.º 1
0
 /**
  * @param $annotation_name string
  * @param $multiple        boolean
  * @return Annotation|Annotation[] depending on $multiple value
  */
 private function getCachedAnnotation($annotation_name, $multiple)
 {
     if (isset($this->annotations[$annotation_name])) {
         return $this->annotations[$annotation_name];
     }
     $path = $this->getAnnotationCachePath();
     if (isset($path)) {
         if (!isset(self::$annotations_cache[$path[0]][$path[1]][$annotation_name][$multiple]) && $this instanceof Has_Doc_Comment) {
             /** @var $this Annoted|Has_Doc_Comment */
             self::$annotations_cache[$path[0]][$path[1]][$annotation_name][$multiple] = Parser::byName($this, $annotation_name, $multiple);
         }
         return self::$annotations_cache[$path[0]][$path[1]][$annotation_name][$multiple];
     } else {
         /** @var $this Annoted|Has_Doc_Comment */
         return Parser::byName($this, $annotation_name, $multiple);
     }
 }