protected static function mapRootExtra(array $packageExtra, $packagePrettyName)
    {
        if (isset($packageExtra[$packagePrettyName])) {
            return $packageExtra[$packagePrettyName];
        }

        if (strpos($packagePrettyName, '/') !== false) {
            list($vendor, $name) = explode('/', $packagePrettyName);
        } else {
            $vendor = '';
            $name = $packagePrettyName;
        }

        foreach ($packageExtra as $key => $value) {
            if ((substr($key, 0, 5) === 'name:') && (substr($key, 5) === $name)) {
                return $value;
            } elseif ((substr($key, 0, 7) === 'vendor:') && (substr($key, 7) === $vendor)) {
                return $value;
            }
        }

        return null;
    }