Example #1
0
 public function compile()
 {
     if ($this->keyNode !== null) {
         return sprintf('%s=>%s', $this->keyNode->compile(), $this->valueNode->compile());
     } else {
         return $this->valueNode->compile();
     }
 }
Example #2
0
 public function __construct(array $tokens, array $childNodes = [])
 {
     parent::__construct($tokens, $childNodes);
 }
Example #3
0
 public function __construct(Token $varToken)
 {
     parent::__construct(['var' => $varToken]);
 }
Example #4
0
 public function __construct(Token $constantToken)
 {
     parent::__construct(['constant' => $constantToken]);
 }
Example #5
0
 public function compile()
 {
     return sprintf('(%s%s%s)', $this->leftNode->compile(), $this->opToken->getValue(), $this->rightNode->compile());
 }
Example #6
0
 public function compile()
 {
     return sprintf('(%s?%s:%s)', $this->ifNode->compile(), $this->ifBodyNode->compile(), $this->elseBodyNode->compile());
 }
Example #7
0
 public function __construct(Token $phpToken)
 {
     parent::__construct(['php' => $phpToken]);
 }
Example #8
0
 public function __construct(AbstractNode $expressionNode = null, Token $textToken = null)
 {
     parent::__construct(['text' => $textToken], ['expression' => $expressionNode]);
 }
Example #9
0
 public function __construct($tagParser)
 {
     parent::__construct(['tag' => $tagParser->getTagToken()], $tagParser->getAttributes());
     $this->tagParser = $tagParser;
 }