/** * @test */ public function pushAndGetFromStackWorks() { $rootNode = new \TYPO3\Fluid\Core\Parser\SyntaxTree\RootNode(); $this->parsingState->pushNodeToStack($rootNode); $this->assertSame($rootNode, $this->parsingState->getNodeFromStack($rootNode), 'Node returned from stack was not the right one.'); $this->assertSame($rootNode, $this->parsingState->popNodeFromStack($rootNode), 'Node popped from stack was not the right one.'); }
/** * Handler for array syntax. This creates the array object recursively and * adds it to the current node. * * @param ParsingState $state The current parsing state * @param string $arrayText The array as string. * @return void */ protected function arrayHandler(ParsingState $state, $arrayText) { /** @var $arrayNode ArrayNode */ $arrayNode = $this->objectManager->get(\TYPO3\Fluid\Core\Parser\SyntaxTree\ArrayNode::class, $this->recursiveArrayHandler($arrayText)); $state->getNodeFromStack()->addChildNode($arrayNode); }
/** * Handler for array syntax. This creates the array object recursively and * adds it to the current node. * * @param \TYPO3\Fluid\Core\Parser\ParsingState $state The current parsing state * @param string $arrayText The array as string. * @return void */ protected function arrayHandler(\TYPO3\Fluid\Core\Parser\ParsingState $state, $arrayText) { $state->getNodeFromStack()->addChildNode($this->objectManager->create('TYPO3\\Fluid\\Core\\Parser\\SyntaxTree\\ArrayNode', $this->recursiveArrayHandler($arrayText))); }
/** * Handler for array syntax. This creates the array object recursively and * adds it to the current node. * * @param \TYPO3\Fluid\Core\Parser\ParsingState $state The current parsing state * @param string $arrayText The array as string. * @return void */ protected function arrayHandler(\TYPO3\Fluid\Core\Parser\ParsingState $state, $arrayText) { $state->getNodeFromStack()->addChildNode(new \TYPO3\Fluid\Core\Parser\SyntaxTree\ArrayNode($this->recursiveArrayHandler($arrayText))); }