Esempio n. 1
0
 protected function compileCode(&$code)
 {
     $code .= 'return ';
     if ($this->value !== null) {
         $this->value->compileCode($code);
     }
 }
Esempio n. 2
0
 protected function compileCode(&$code)
 {
     if ($this->isUnpacked) {
         $code .= '...';
     }
     $this->value->compileCode($code);
 }
Esempio n. 3
0
 protected function compileCode(&$code)
 {
     $this->value->compileCode($code);
     $code .= '[';
     if ($this->index !== null) {
         $this->index->compileCode($code);
     }
     $code .= ']';
 }
Esempio n. 4
0
 protected function compileCode(&$code)
 {
     if ($this->name instanceof ValueExpression && self::isNormalSyntaxName($this->name->getValue())) {
         $code .= '$' . $this->name->getValue();
     } else {
         $code .= '${';
         $this->name->compileCode($code);
         $code .= '}';
     }
 }
Esempio n. 5
0
 protected function compileCode(&$code)
 {
     if ($this->name instanceof ValueExpression) {
         $code .= $this->name->getValue();
     } else {
         $this->name->compileCode($code);
     }
     $code .= '(';
     $code .= implode(',', self::compileAll($this->arguments));
     $code .= ')';
 }
 protected function compileCode(&$code)
 {
     $code .= '(';
     $this->leftOperand->compileCode($code);
     $code .= ' ' . $this->operator . ' ';
     if ($this->operator === Operators\Binary::IS_INSTANCE_OF && $this->rightOperand instanceof ValueExpression) {
         $code .= $this->rightOperand->getValue();
     } else {
         $this->rightOperand->compileCode($code);
     }
     $code .= ')';
 }
Esempio n. 7
0
 protected function compileCode(&$code)
 {
     $code .= '(';
     $this->condition->compileCode($code);
     $code .= ' ? ';
     if ($this->ifTrue !== null) {
         $this->ifTrue->compileCode($code);
     }
     $code .= ' : ';
     $this->ifFalse->compileCode($code);
     $code .= ')';
 }
Esempio n. 8
0
 protected function compileCode(&$code)
 {
     $this->value->compileCode($code);
     $code .= '->';
     if ($this->name instanceof ValueExpression && self::isNormalSyntaxName($this->name->getValue())) {
         $code .= $this->name->getValue();
     } else {
         $code .= '{';
         $this->name->compileCode($code);
         $code .= '}';
     }
     $code .= '(';
     $code .= implode(',', self::compileAll($this->arguments));
     $code .= ')';
 }
Esempio n. 9
0
 protected function compileType(&$code, Expression $typeExpression)
 {
     if ($typeExpression instanceof ValueExpression) {
         $code .= $typeExpression->getValue();
     } else {
         $typeExpression->compileCode($code);
     }
 }
Esempio n. 10
0
 protected function compileCode(&$code)
 {
     if ($this->key !== null) {
         $this->key->compileCode($code);
         $code .= ' => ';
     }
     if ($this->isReference) {
         $code .= '&';
     }
     $this->value->compileCode($code);
 }
Esempio n. 11
0
 protected function compileCode(&$code)
 {
     if ($this->typeHint !== null) {
         $code .= $this->typeHint . ' ';
     }
     if ($this->isPassedByReference) {
         $code .= '&';
     }
     if ($this->isVariadic) {
         $code .= '...';
     }
     $code .= '$' . $this->name;
     if ($this->defaultValue !== null) {
         $code .= ' = ';
         $this->defaultValue->compileCode($code);
     }
 }
Esempio n. 12
0
 protected function compileCode(&$code)
 {
     $code .= 'empty(';
     $this->value->compileCode($code);
     $code .= ')';
 }
Esempio n. 13
0
 protected function compileCode(&$code)
 {
     $code .= $this->castType;
     $this->castValue->compileCode($code);
 }