public static function getClassName($class)
    {
        if (!is_object($class) && !is_string($class)) {
            throw new InvalidArgumentException(sprintf('$object must be a string or an object, %s given', gettype($class)));
        }

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

        if ($pos !== false) {
            $className = substr($className, ($pos + 1));
        }

        return $className;
    }