/** * @param ClassNode $node */ private function setupTemplateDefaults(ClassNode $node) { if ($this->autofilter === 1) { $this->extension = $this->getExtension($node->getTemplateName()); $this->autofilterStack[] = $this->autofilter; $this->autofilter = $this->extension; } }
public function parseTemplate(Stream $stream, $templateName) { $fileNode = new FileNode($this->environment); $this->fileNode = $fileNode; $this->classNode = $fileNode->addClass($templateName); $this->classNode->addChild($this->parseBlock($stream, null, Token::EOF), ClassNode::MAIN_TEMPLATE_BLOCK); return $fileNode; }
private function isBlockRoot(Node $node) { if (!isset($this->currentClassNode)) { return false; } if (!$node instanceof RootNode) { return false; } return in_array($node, $this->currentClassNode->getChildren(), true); }
public function testGetNameSpace() { $this->assertEquals('Test', $this->node->getNameSpace()); }