/** * @param Node $operand * * @return bool */ private function isPropertyAccessOperator(Node $operand) { if (!$operand instanceof OperatorNode) { return false; } return $operand->getOperator() instanceof PropertyAccessOperator; }
public function addChild(Node $node, $key = null) { if (!$node instanceof RootNode) { throw new \InvalidArgumentException('ClassNode expects only RootNode children'); } return parent::addChild($node, $key); }
/** * @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'; }
public function __construct($name) { parent::__construct(['name' => $name]); }
public function compileNode(Node $node) { $node->compile($this); return $this; }