예제 #1
0
 /**
  * @param string $type
  * @param array $args
  */
 function __construct($type, $args = array())
 {
     $args['doc_type'] = $type;
     if (!Util::is_builtin_type($type)) {
         $args['class_name'] = $type;
         $args['local_class'] = Util::parse_local_class($type);
         $args['namespace'] = isset($args['namespace']) ? $args['namespace'] : Util::parse_namespace($type);
         if (preg_match('#(.*?)\\[\\]$#', $type, $match)) {
             $args['base_type'] = 'array';
             $args['array_of'] = 'object';
             $args['class_name'] = $match[1];
         } else {
             $args['base_type'] = 'object';
         }
     } else {
         $args['base_type'] = $type;
         if ('[]' === substr($type, -2)) {
             $args['array_of'] = substr($type, 0, -2);
             $args['base_type'] = 'array';
         } else {
             if ('array' === $type) {
                 $args['array_of'] = 'mixed';
             }
         }
     }
     parent::__construct($args);
 }
예제 #2
0
 /**
  * @param Object $object
  * @param Generator $parent
  * @param array $args
  */
 function __construct($object, $parent, $args = array())
 {
     $this->initialize($object, $parent);
     parent::__construct($args);
 }