Filter.php
public static function wrapCode(Node $node, $indent, $newLine)
    {

        $text = self::filterPlain($node, $indent, $newLine);
        $text = preg_replace(['/^\s*<\?php ?/i', '/\?>\s*$/'], '', $text);

        return $indent.'<?php '.$newLine.$text.$newLine.$indent.'?>'.$newLine;
    }
public static function wrapCode(Node $node, $indent, $newLine)
    {

        $text = self::filterPlain($node, $indent, $newLine);
        $text = preg_replace(['/^\s*<\?php ?/i', '/\?>\s*$/'], '', $text);

        return $indent.'<?php '.$newLine.$text.$newLine.$indent.'?>'.$newLine;
    }
public static function wrapCode ( Node $ node , $ indent , $ newLine ) { $ text = self :: filterPlain ( $ node , $ indent , $ newLine ) ; $ text = preg_replace ( [ '/^\s*<\?php ?/i' , '/\?>\s*$/' ] , '' , $ text ) ; return $ indent . '<?php ' . $ newLine . $ text . $ newLine . $ indent . '?>' . $ newLine ; }
Similar to wrapTag, but rather puts PHP-instruction-tags around the text.

This will create working PHP expressions.

If <?php or ? > are already found, they will be trimmed and re-appended
correctly to avoid failing nested expressions (<?php can't be used
_inside_ <?php)

@param Node   $node    the node to be wrapped
@param string $indent  the indentation to use on each child
@param string $newLine the new-line to append after each line

@return string the wrapped PHP-string
Similar to wrapTag but rather puts PHP - instruction - tags around the text .