src/Utilities/Reflection.php
public static function getClassNamespace($source)
    {
        $fullClassName = self::getClassName($source);

        if (null === $fullClassName || '' === $fullClassName) {
            return '';
        }

        $className = self::getClassName($source, true);

        if ($className === $fullClassName) {
            return $className;
        }

        return Miscellaneous::getStringWithoutLastElement($fullClassName, '\\');
    }
public static function getClassNamespace($source)
    {
        $fullClassName = self::getClassName($source);

        if (null === $fullClassName || '' === $fullClassName) {
            return '';
        }

        $className = self::getClassName($source, true);

        if ($className === $fullClassName) {
            return $className;
        }

        return Miscellaneous::getStringWithoutLastElement($fullClassName, '\\');
    }
public static function getClassNamespace ( $ source ) { $ fullClassName = self :: getClassName ( $ source ) ; if ( null === $ fullClassName || '' === $ fullClassName ) { return '' ; } $ className = self :: getClassName ( $ source , true ) ; if ( $ className === $ fullClassName ) { return $ className ; } return Miscellaneous :: getStringWithoutLastElement ( $ fullClassName , '\\' ) ; }
Returns namespace of class for given source

@param array|object|string $source An array of objects, namespaces, object or namespace
@return string
Returns namespace of class for given source