src/PhpToZephir/Converter/Printer/StmtsPrinter.php
public function convert(array $nodes, $indent = true)
    {
        $result = '';
        foreach ($nodes as $node) {
            $result .= "\n"
                    .$this->pComments($node->getAttribute('comments', array()))
                    .$this->dispatcher->p($node)
                    .($node instanceof Expr ? ';' : '');
        }

        if ($indent) {
            return preg_replace('~\n(?!$|'.Dispatcher::noIndentToken.')~', "\n    ", $result);
        } else {
            return $result;
        }
    }
public function convert(array $nodes, $indent = true)
    {
        $result = '';
        foreach ($nodes as $node) {
            $result .= "\n"
                    .$this->pComments($node->getAttribute('comments', array()))
                    .$this->dispatcher->p($node)
                    .($node instanceof Expr ? ';' : '');
        }

        if ($indent) {
            return preg_replace('~\n(?!$|'.Dispatcher::noIndentToken.')~', "\n    ", $result);
        } else {
            return $result;
        }
    }
public function convert ( array $ nodes , $ indent = true ) { $ result = '' ; foreach ( $ nodes as $ node ) { $ result .= "\n" . $ this -> pComments ( $ node -> getAttribute ( 'comments' , array ( ) ) ) . $ this -> dispatcher -> p ( $ node ) . ( $ node instanceof Expr ? ';' : '' ) ; } if ( $ indent ) { return preg_replace ( '~\n(?!$|' . Dispatcher :: noIndentToken . ')~' , "\n    " , $ result ) ; } else { return $ result ; } }
Pretty prints an array of nodes (statements) and indents them optionally.

@param Node[] $nodes  Array of nodes
@param bool   $indent Whether to indent the printed nodes

@return string Pretty printed statements
Pretty prints an array of nodes ( statements ) and indents them optionally .