示例#1
0
 public function instantiateAnnotation($class, $parameters, $targetReflection = false)
 {
     $class = Addendum::resolveClassName($class);
     // FIXME
     if (class_exists($class) && is_subclass_of($class, 'Addendum\\Annotation') && !Addendum::ignores($class) || $class === 'Addendum\\Annotation') {
         $annotationReflection = new \ReflectionClass($class);
         return $annotationReflection->newInstance($parameters, $targetReflection);
     }
     return false;
 }
示例#2
0
 public function build($targetReflection)
 {
     $data = $this->parse($targetReflection);
     $annotations = array();
     foreach ($data as $class => $parameters) {
         if (!Addendum::ignores($class)) {
             foreach ($parameters as $params) {
                 $annotationReflection = new ReflectionClass($class);
                 $annotations[$class][] = $annotationReflection->newInstance($params, $targetReflection);
             }
         }
     }
     return $annotations;
 }
 public function build($targetReflection)
 {
     $data = $this->parse($targetReflection);
     $annotations = array();
     foreach ($data as $class => $parameters) {
         if (!Addendum::ignores($class)) {
             switch ($class) {
                 case 'Annotation':
                 case 'Target':
                     $class_name = $class;
                     break;
                 default:
                     $class_name = $class . 'Annotation';
             }
             foreach ($parameters as $params) {
                 $annotationReflection = new ReflectionClass($class_name);
                 $annotations[$class][] = $annotationReflection->newInstance($params, $targetReflection);
             }
         }
     }
     return $annotations;
 }
示例#4
0
 public function instantiateAnnotation($class, $parameters, $targetReflection = FALSE)
 {
     $class = Addendum::resolveClassName($class);
     if (is_subclass_of($class, 'Annotation') && !Addendum::ignores($class) || $class == 'Annotation') {
         $annotationReflection = new ReflectionClass($class);
         return $annotationReflection->newInstance($parameters, $targetReflection);
     }
     return FALSE;
 }