Esempio n. 1
0
 public function getRawAnnotation($s)
 {
     $reader = new AnnotationReader();
     if (is_string($s)) {
         if (class_exists($s)) {
             return $reader->getClass($s);
         } elseif (function_exists($s)) {
             return $reader->getFunction($s);
         }
     } elseif (is_array($s) && is_callable($s)) {
         if (method_exists($s[0], $s[1])) {
             return $reader->getMethod($s[0], $s[1]);
         } elseif (is_callable([$s[0], 'isCallable'])) {
             $func = $s[0]->isCallable($s[1]);
             if ($func) {
                 if (is_object($func)) {
                     return $this->getRawAnnotation([$func, '__invoke']);
                 } else {
                     return $this->getRawAnnotation($func);
                 }
             }
         }
     }
     if (is_a($s, 'Closure')) {
         return $reader->getFunction($s);
     }
     return null;
 }