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, '\\');
    }