src/Sp/FixtureDumper/Util/ClassUtils.php
public static function getNamespace($class)
    {
        if (!is_object($class) && !is_string($class)) {
            throw new InvalidArgumentException('$object must be a string or an object');
        }

        $class = (is_string($class) ? $class : get_class($class));
        $pos = strrpos($class, '\\');

        return substr($class, 0, $pos);
    }
public static function getNamespace($class)
    {
        if (!is_object($class) && !is_string($class)) {
            throw new InvalidArgumentException('$object must be a string or an object');
        }

        $class = (is_string($class) ? $class : get_class($class));
        $pos = strrpos($class, '\\');

        return substr($class, 0, $pos);
    }
Get the namespace from a given class or object.

@param mixed $class

@return string
@throws \InvalidArgumentException