public function extractClassNameFromUse(string $use)
    {
        $matches = [];

        if (preg_match(self::USE_CLASS_EXTRACT_REGEXP, $use, $matches) === 0) {
            throw new InvalidNamespaceException($use);
        }

        $className = $matches['classname'];
        $namespace = array_key_exists('namespace', $matches) ? $matches['namespace'] : '';

        if (substr($namespace, -1, 1) === '\\') {
            $namespace = substr($namespace, 0, -1);
        }

        return [
            $className,
            $namespace
        ];
    }