protected function getCodeWrappedIntoNamespace(array $parsed, $pretty)
    {
        if ($this->parsedCodeHasNamespaces($parsed)) {
            $pretty = preg_replace('/^\s*(namespace.*);/im', '${1} {', $pretty, 1)."\n}\n";
        } else {
            $pretty = sprintf("namespace {\n%s\n}\n", $pretty);
        }

        return preg_replace('/(?<!.)[\r\n]+/', '', $pretty);
    }
protected function getCodeWrappedIntoNamespace(array $parsed, $pretty)
    {
        if ($this->parsedCodeHasNamespaces($parsed)) {
            $pretty = preg_replace('/^\s*(namespace.*);/im', '${1} {', $pretty, 1)."\n}\n";
        } else {
            $pretty = sprintf("namespace {\n%s\n}\n", $pretty);
        }

        return preg_replace('/(?<!.)[\r\n]+/', '', $pretty);
    }
protected function getCodeWrappedIntoNamespace ( array $ parsed , $ pretty ) { if ( $ this -> parsedCodeHasNamespaces ( $ parsed ) ) { $ pretty = preg_replace ( '/^\s*(namespace.*);/im' , '${1} {' , $ pretty , 1 ) . "\n}\n" ; } else { $ pretty = sprintf ( "namespace {\n%s\n}\n" , $ pretty ) ; } return preg_replace ( '/(?<!.)[\r\n]+/' , '' , $ pretty ) ; }
Wrap the code into a namespace.

@param array  $parsed
@param string $pretty

@return string
Wrap the code into a namespace .