public static function getFormatNamespace($namespace, $leadingBackslash = false, $closingBackslash = true)
    {
        $namespace = trim($namespace, '\\');

        // if it does not end with a backslash add it.
        if ($closingBackslash) {
            $namespace = sprintf('%s\\', $namespace);
        }

        // if it does not start with a backslash add it.
        if ($leadingBackslash) {
            $namespace = sprintf('\\%s', $namespace);
        }

        return $namespace;
    }
public static function getFormatNamespace($namespace, $leadingBackslash = false, $closingBackslash = true)
    {
        $namespace = trim($namespace, '\\');

        // if it does not end with a backslash add it.
        if ($closingBackslash) {
            $namespace = sprintf('%s\\', $namespace);
        }

        // if it does not start with a backslash add it.
        if ($leadingBackslash) {
            $namespace = sprintf('\\%s', $namespace);
        }

        return $namespace;
    }
public static function getFormatNamespace ( $ namespace , $ leadingBackslash = false , $ closingBackslash = true ) { $ namespace = trim ( $ namespace , '\\' ) ; // if it does not end with a backslash add it. if ( $ closingBackslash ) { $ namespace = sprintf ( '%s\\' , $ namespace ) ; } // if it does not start with a backslash add it. if ( $ leadingBackslash ) { $ namespace = sprintf ( '\\%s' , $ namespace ) ; } return $ namespace ; }
Format a namespace to have a  leading or a closing backslash or both.

@param            $namespace
@param bool|false $leadingBackslash
@param bool|true  $closingBackslash

@return string

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
Format a namespace to have a leading or a closing backslash or both .