Ejemplo n.º 1
0
 public function storeMethod(ParsedMethod $method, ParsedType $type)
 {
     $n = strtolower($type->getName());
     if (empty($this->methods[$n])) {
         $this->methods[$n] = [];
     }
     $this->methods[$n][strtolower($method->getName())] = $method;
 }
Ejemplo n.º 2
0
 public function __construct(TypeInfoInterface $type, ParsedMethod $method)
 {
     $this->key = $type->getKey() . ':method:' . strtolower($method->getName());
     $this->type = $type;
     $this->method = $method;
 }
Ejemplo n.º 3
0
 protected function parseMethodBody(SourceStream $code, SourceBuffer $buffer, ParsedMethod $method = NULL)
 {
     $depth = $code->depth();
     while (true) {
         if ($code->depth() == $depth && $code->peek(1) == '}') {
             return;
         }
         $tt = $code->next($buffer);
         if (is_array($tt)) {
             if ($tt[0] == T_FUNCTION) {
                 $buffer->append($tt);
                 $this->parseMethodBody($code, $buffer);
                 continue;
             }
             if ($tt[0] == T_YIELD && $method !== NULL) {
                 $method->setIsGenerator(true);
             }
         }
         $buffer->append($tt);
     }
 }