protected function optimizePrintNode(Twig_NodeInterface $node, Twig_Environment $env)
    {
        if (!$node instanceof Twig_Node_Print) {
            return $node;
        }

        if (
            $node->getNode('expr') instanceof Twig_Node_Expression_BlockReference ||
            $node->getNode('expr') instanceof Twig_Node_Expression_Parent
        ) {
            $node->getNode('expr')->setAttribute('output', true);

            return $node->getNode('expr');
        }

        return $node;
    }
protected function optimizePrintNode(Twig_NodeInterface $node, Twig_Environment $env)
    {
        if (!$node instanceof Twig_Node_Print) {
            return $node;
        }

        if (
            $node->getNode('expr') instanceof Twig_Node_Expression_BlockReference ||
            $node->getNode('expr') instanceof Twig_Node_Expression_Parent
        ) {
            $node->getNode('expr')->setAttribute('output', true);

            return $node->getNode('expr');
        }

        return $node;
    }
protected function optimizePrintNode ( Twig_NodeInterface $ node , Twig_Environment $ env ) { if ( ! $ node instanceof Twig_Node_Print ) { return $ node ; } if ( $ node -> getNode ( 'expr' ) instanceof Twig_Node_Expression_BlockReference || $ node -> getNode ( 'expr' ) instanceof Twig_Node_Expression_Parent ) { $ node -> getNode ( 'expr' ) -> setAttribute ( 'output' , true ) ; return $ node -> getNode ( 'expr' ) ; } return $ node ; }
Optimizes print nodes.

It replaces:

* "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()"

@param Twig_NodeInterface $node A Node
@param Twig_Environment   $env  The current Twig environment
Optimizes print nodes .