Exemplo n.º 1
0
 protected function createVar(Tag $tag)
 {
     $name = trim($tag->getVariableName(), '$');
     $param = new Variable($name);
     $param->setType($this->getFQCN($tag->getType()));
     return $param;
 }
Exemplo n.º 2
0
 public function addVar(Variable $var)
 {
     $this->vars[$var->getName()] = $var;
 }
Exemplo n.º 3
0
 public function addVarToScope(Assign $node)
 {
     if (!$node->var instanceof NodeVar) {
         return;
     }
     $var = new Variable($node->var->name);
     $comment = $this->commentParser->parse($node->getAttribute('comments'));
     if ($comment->getVar($var->getName())) {
         $type = $comment->getVar($var->getName())->getType();
     } else {
         $type = $this->typeResolver->getType($node->expr, $this->getIndex(), $this->scope);
     }
     $var->setType($type);
     $this->scope->addVar($var);
 }
Exemplo n.º 4
0
 protected function createEntry(Variable $var)
 {
     $type = $var->getType() instanceof FQCN ? $var->getType()->toString() : $var->getType();
     return new Entry($var->getName(), $type);
 }