maps the browser version

@param string|null $browserVersion
@param string|null $browserName

@return \BrowserDetector\Version\VersionInterface
960870
public function mapBrowserVersion(?string $browserVersion, ?string $browserName = null): VersionInterface
    {
        return (new BrowserVersionMapper())->mapBrowserVersion($browserVersion, $browserName);
    }
220165
public function setVersion($version)
    {
        $this->version
            = preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version)
            ? $version
            : '';

        $this->content = null;
        return $this;
    }
818853
public function mapOsVersion(?string $osVersion, ?string $osName = null): VersionInterface
    {
        if (null === $osVersion) {
            return new Version();
        }

        switch (mb_strtolower($osVersion)) {
            case '':
            case 'unknown':
            case 'other':
                return new Version();
                break;
            case 'server 2003':
                return new Version('2003');
                break;
            case 'nt 5.1':
                return (new VersionFactory())->set('XP');
                break;
            case 'nt 6.1':
                return new Version('7');
                break;
            case 'nt 6.2':
                return new Version('8');
                break;
            case 'nt 6.3':
                return new Version('8', '1');
                break;
            default:
                // nothing to do here
                break;
        }

        if (null === $osName) {
            return new Version();
        }

        switch (mb_strtolower($osName)) {
            case '':
            case 'unknown':
            case 'other':
                return new Version();
                break;
            case 'winxp':
            case 'windows xp':
            case 'nt 5.1':
                return (new VersionFactory())->set('XP');
                break;
            case 'winvista':
            case 'windows vista':
            case 'nt 6.0':
                return (new VersionFactory())->set('Vista');
                break;
            case 'win7':
            case 'winphone7':
            case 'windows phone 7':
            case 'windows 7':
            case 'nt 6.1':
                return new Version('7');
                break;
            case 'winphone7.5':
            case 'windows phone 7.5':
                return new Version('7', '5');
                break;
            case 'win8':
            case 'winrt8':
            case 'winphone8':
            case 'windows phone 8':
            case 'windows 8':
            case 'nt 6.2':
                return new Version('8');
                break;
            case 'win8.1':
            case 'winrt8.1':
            case 'winphone8.1':
            case 'windows phone 8.1':
            case 'windows 8.1':
            case 'nt 6.3':
                return new Version('8', '1');
                break;
            case 'win9':
                return new Version('9');
                break;
            case 'win10':
            case 'windows 10':
                return new Version('10');
                break;
            case 'win2000':
            case 'windows 2000':
            case 'nt 5.0':
                return new Version('2000');
                break;
            case 'win2003':
                return new Version('2003');
                break;
            case 'win98':
            case 'windows 98':
                return new Version('98');
                break;
            case 'win95':
                return new Version('95');
                break;
            case 'winnt':
                return (new VersionFactory())->set('NT');
                break;
            case 'winme':
                return (new VersionFactory())->set('ME');
                break;
            case 'win31':
                return new Version('3', '1');
                break;
            case 'win32':
                return new Version();
                break;
            case 'yosemite 10.10':
                return new Version('10', '10');
                break;
            case 'mavericks 10.9':
                return new Version('10', '9');
                break;
            default:
                // nothing to do here
                break;
        }

        return (new VersionFactory())->set($osVersion);
    }
1082190
public function version($version = null)
    {
        if (func_num_args() === 0) {
            return $this->_version;
        }
        $headers = $this->headers();
        $headers->prepend('MIME-Version', $version);
        $this->_version = $version;
        return $this;
    }
1289315
public function tagVersion($consumerName, $version, $tagName)
    {
        $request = $this->requestBuilder->createTagVersionRequest($this->baseUrl, $consumerName, $version, $tagName);

        $response = $this->client->sendRequest($request);
        $this->checkIfResponseIsCorrect($response);

        return $response;
    }
953583
public function detectVersion(string $useragent): VersionInterface
    {
        $version = (new Trident())->detectVersion($useragent);

        $versions = [
            '8' => '11.0',
            '7' => '11.0',
            '6' => '10.0',
            '5' => '9.0',
            '4' => '8.0',
        ];

        foreach ($versions as $engineVersion => $ieVersion) {
            if (version_compare($version->getMajor(), (string) $engineVersion, '>=')) {
                return (new VersionFactory())->set($ieVersion);
            }
        }

        $doMatch = preg_match('/MSIE ([\d\.]+)/', $useragent, $matches);

        if ($doMatch) {
            return (new VersionFactory())->set($matches[1]);
        }

        return (new VersionFactory())->set('0');
    }
1305794
public function getServerVersion()
    {
        if (!$this->serverVersion) {
            $this->method = 'getServerVersion';
            $this->sendRequest();
            $this->method = null;
        }

        return $this->serverVersion;
    }
909532
public function version(string $value = null)
    {
        if (null === $value) {
            return $this->version;
        }
        $this->version = $value;
        return $this;
    }
1015775
public function withProtocolVersions(array $versions): self {
        $versions = \array_unique($versions);

        if (empty($versions)) {
            throw new \Error("Empty array of protocol versions provided, must not be empty.");
        }

        foreach ($versions as $version) {
            if (!\in_array($version, ["1.0", "1.1", "2.0"], true)) {
                throw new \Error(
                    "Invalid HTTP protocol version: " . $version
                );
            }
        }

        if ($this->protocolVersions === $versions) {
            return $this;
        }

        $clone = clone $this;
        $clone->protocolVersions = $versions;

        return $clone;
    }
563535
public function version($version = null)
    {
        if (!$version) {
            $versionParts = explode('.', \Peridot\Console\Version::NUMBER);
            $versionParts[count($versionParts)-1]++;
            $version = implode('.', $versionParts);
        }
        $versionFile = __DIR__ . '/src/Console/Version.php';
        $this->taskReplaceInFile($versionFile)
            ->from('NUMBER = "' . \Peridot\Console\Version::NUMBER . '"')
            ->to('NUMBER = "' . $version . '"')
            ->run();

        return $version;
    }
1044654
public function detectVersion(string $useragent): VersionInterface
    {
        if (false !== mb_stripos($useragent, 'bb10') && false === mb_stripos($useragent, 'version')) {
            return (new VersionFactory())->set('10.0.0');
        }

        $searches = ['BlackBerry[0-9a-z]+', 'BlackBerry; [0-9a-z]+\/', 'BlackBerrySimulator'];

        if (false !== mb_stripos($useragent, 'bb10') || false === mb_stripos($useragent, 'opera')) {
            array_unshift($searches, 'Version');
        }

        return (new VersionFactory())->detectVersion($useragent, $searches);
    }
1314022
public function uses(string $service, ?string $version = null): Contracts\Request
    {
        if (\is_null($version) || ! \array_key_exists($version, $this->supportedVersions)) {
            $version = $this->defaultVersion;
        }

        $name = \str_replace('.', '\\', $service);
        $class = \sprintf('%s\%s\%s', $this->getResourceNamespace(), $this->supportedVersions[$version], $name);

        if (! \class_exists($class)) {
            throw new InvalidArgumentException("Resource [{$service}] for version [{$version}] is not available.");
        }

        return $this->via(new $class($this));
    }
165652
public function resolve(ElementVersion $elementVersion)
    {
        $elementtype = $this->elementService->findElementtype($elementVersion->getElement());

        if (!$elementtype->getMetaSetId()) {
            return null;
        }

        $metaSet = $this->metaSetManager->find($elementtype->getMetaSetId());

        return $metaSet;
    }
877052
function (browserName, config) {
    var browsers = config.get('browsers');

    // check if we couldnt find a configured alias,
    // set to defaults otherwise
    if (!browsers) {
      return {actAs: this.desiredCapabilities.browserName, version: this.desiredCapabilities['browser-version']};
    }
    var browser = config.get('browsers')[0][browserName] || null;
    // check if we couldnt find a configured alias,
    // check and apply if there is a default config
    if (!browser && this.browsers[browserName]) {
      browser = this.browsers[browserName];
    }

    // check if the actas property has been set, if not
    // use the given browser name
    if (!browser.actAs) {
      browser.actAs = browserName;
    }

    return browser;
  }
867331
public function withProtocolVersion($version)
    {
        if ($this->getProtocolVersion() === $version) {
            return $this;
        }

        $newInstance = clone $this;
        $newInstance->setProtocolVersion($version);
        return $newInstance;
    }
942156
public function getBrowserVersion($refresh = false)
    {
        if (empty($this->detection['browser']) || $refresh) {
            $this->detectBrowser($this->userAgent);
        }

        return $this->browserVersion;
    }
204655
public function detectVersion(string $useragent): VersionInterface
    {
        $doMatch = preg_match('/ObigoInternetBrowser\/QO?([\d.]+)/', $useragent, $matches);

        if ($doMatch) {
            return (new VersionFactory())->set($matches[1]);
        }

        $doMatch = preg_match('/obigo\-browser\/q([\d.]+)/i', $useragent, $matches);

        if ($doMatch) {
            return (new VersionFactory())->set($matches[1]);
        }

        $doMatch = preg_match('/(?:teleca|obigo)[\-\/]q([\d.]+)/i', $useragent, $matches);

        if ($doMatch) {
            return (new VersionFactory())->set($matches[1]);
        }

        return (new VersionFactory())->set('0');
    }