/**
  * @param Node $operand
  *
  * @return bool
  */
 private function isPropertyAccessOperator(Node $operand)
 {
     if (!$operand instanceof OperatorNode) {
         return false;
     }
     return $operand->getOperator() instanceof PropertyAccessOperator;
 }
Beispiel #2
0
 public function addChild(Node $node, $key = null)
 {
     if (!$node instanceof RootNode) {
         throw new \InvalidArgumentException('ClassNode expects only RootNode children');
     }
     return parent::addChild($node, $key);
 }
Beispiel #3
0
 /**
  * @param Node $node
  * @param      $for
  */
 private function addFilterNode(Node $node, $for)
 {
     if (!$this->environment->hasFunction('filter_' . $for)) {
         $for = $this->defaultAutofilterStrategy;
     }
     $node->addChild(new FunctionNode('filter_' . $for, [$node->getChild('expression')]), 'expression');
 }
 private function isEnvironmentVariable(Node $node)
 {
     return $node instanceof TempVariableNode && $node->getData('name') === 'environment';
 }
Beispiel #5
0
 public function __construct($name)
 {
     parent::__construct(['name' => $name]);
 }
Beispiel #6
0
 public function compileNode(Node $node)
 {
     $node->compile($this);
     return $this;
 }