@param string $userAgent

@return null|string
427679
public function applyConclusiveMatch($userAgent)
    {
        $tolerance = Utils::toleranceToRisDelimeter($userAgent);
        if ($tolerance !== false) {
            return $this->getDeviceIDFromRIS($userAgent, $tolerance);
        }

        return WurflConstants::NO_MATCH;
    }
709243
public function setUserAgent($userAgent)
    {
        if (is_null($userAgent)) {
            foreach ($this->getUaHttpHeaders() as $altHeader) {
                if (isset($this->httpHeaders[$altHeader])) {
                    $userAgent .= $this->httpHeaders[$altHeader].' ';
                }
            }
        }

        return $this->userAgent = $userAgent;
    }
1269450
public function normalize($userAgent)
    {
        // Don't normalize generic user agents
        if (substr($userAgent, 0, 12) == 'DO_NOT_MATCH') {
            return $userAgent;
        }
        $normalizedUserAgent = $userAgent;
        foreach ($this->_userAgentNormalizers as $normalizer) {
            $normalizedUserAgent = $normalizer->normalize($normalizedUserAgent);
        }
        return $normalizedUserAgent;
    }
12919
public static function isMobileBrowser($userAgent)
    {
        if (self::$_is_mobile_browser !== null) {
            return self::$_is_mobile_browser;
        }
        self::$_is_mobile_browser = false;
        $userAgent = strtolower($userAgent);
        foreach (self::$mobileBrowsers as $key) {
            if (strpos($userAgent, $key) !== false) {
                self::$_is_mobile_browser = true;
                break;
            }
        }
        return self::$_is_mobile_browser;
    }
556562
public function getUserAgent()
    {
        if ($this->USER_AGENT) {
            return $this->USER_AGENT;
        }

        if ($this->HTTP_USER_AGENT) {
            return $this->HTTP_USER_AGENT;
        }

        return null;
    }
780993
public function applyRecoveryMatch($userAgent)
    {
        $tolerance = Utils::indexOfOrLength($userAgent, '/', strpos($userAgent, 'Samsung'));

        return $this->getDeviceIDFromRIS($userAgent, $tolerance);
    }
560662
protected function getBrowserParentId(string $userAgent) : int
    {
        if ($this->browserParentId === null) {
            $this->findBrowser($userAgent);
        }

        return $this->browserParentId;
    }
648462
public function applyExactMatch($userAgent)
    {
        if (array_key_exists($userAgent, $this->userAgentsWithDeviceID)) {
            return $this->userAgentsWithDeviceID[$userAgent];
        }

        return WurflConstants::NO_MATCH;
    }
1371908
public function normalize(string $userAgent): string
    {
        $userAgent = preg_replace('/([\d]+)EMobile/', '$1; IEMobile', $userAgent);

        $userAgent = str_replace(
            ['Macintoshntel', 'cpu=PPC=Mac'],
            ['Macintosh; Intel', 'cpu=PPC;os=Mac'],
            $userAgent
        );

        $userAgent = preg_replace('/([\\\\]+)/i', '', $userAgent);
        $userAgent = preg_replace('/Versio\//', 'Version/', $userAgent);

        $userAgent = str_replace(
            ['i686 (x86_64)', 'X11buntu', 'Chr0me'],
            ['i686 on x86_64', 'X11; Ubuntu', 'Chrome'],
            $userAgent
        );

        return $userAgent;
    }
690399
public function applyConclusiveMatch($userAgent)
    {
        $match = $this->lookForMatchingUserAgent($userAgent);

        if (!empty($match)) {
            return $this->userAgentsWithDeviceID[$match];
        }

        return WurflConstants::NO_MATCH;
    }
528926
public function setUserAgent($userAgent) {
		$this->userAgent = $userAgent;
		$this->removeHeader(self::HEADER_KEY_USER_AGENT);
		$this->addHeader(self::HEADER_KEY_USER_AGENT, $userAgent);
		return $this;
	}
255824
public function applyRecoveryMatch($userAgent)
    {
        if (Utils::checkIfContainsAnyOf($userAgent, array('WPDesktop', 'ZuneWP7'))
            || Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))
        ) {
            if (Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))) {
                return 'generic_ms_phone_os10_desktopmode';
            }

            if (Utils::checkIfContains($userAgent, 'WPDesktop')) {
                return 'generic_ms_phone_os8_desktopmode';
            }

            if (Utils::checkIfContains($userAgent, 'Trident/5.0')) {
                return 'generic_ms_phone_os7_5_desktopmode';
            }

            return 'generic_ms_phone_os7_desktopmode';
        }

        $version = self::getWindowsPhoneVersion($userAgent);

        if ($version === '10.0') {
            return 'generic_ms_phone_os10';
        }

        if ($version === '8.1') {
            return 'generic_ms_phone_os8_1';
        }

        if ($version === '8.0') {
            return 'generic_ms_phone_os8';
        }

        if ($version === '7.8') {
            return 'generic_ms_phone_os7_8';
        }

        if ($version === '7.5') {
            return 'generic_ms_phone_os7_5';
        }

        if ($version === '7.0') {
            return 'generic_ms_phone_os7';
        }

        if ($version === '6.5') {
            return 'generic_ms_winmo6_5';
        }

        //These are probably UAs of the type "Windows Phone Ad Client (Xna)/5.1.0.0 BMID/E67970D969"
        if (Utils::checkIfStartsWithAnyOf($userAgent, array('Windows Phone Ad Client', 'WindowsPhoneAdClient'))) {
            return 'generic_ms_phone_os7';
        }

        return WurflConstants::NO_MATCH;
    }
577261
public function lookForMatchingUserAgent($userAgent)
    {
        $tolerance = WURFL_Handlers_Utils::firstSlash($userAgent);
        return WURFL_Handlers_Utils::risMatch(array_keys($this->userAgentsWithDeviceID), $userAgent, $tolerance);
    }
1021165
public function applyConclusiveMatch($userAgent)
    {
        //High accuracy mode
        $tolerance = Utils::firstCloseParen($userAgent);

        return $this->getDeviceIDFromRIS($userAgent, $tolerance);
    }
838287
public function createRequestFromString(string $userAgent): GenericRequest
    {
        if (!HeaderSecurity::isValid($userAgent)) {
            $userAgent = $this->filterHeader($userAgent);
        }

        $message = ServerRequestFactory::fromGlobals([Constants::HEADER_HTTP_USERAGENT => $userAgent]);

        return $this->createRequestFromPsr7Message($message);
    }
968430
public static function getHTCMacModel($userAgent)
    {
        if (preg_match('/(HTC[^;\)]+)/', $userAgent, $matches)) {
            $model = preg_replace('#[ _\-/]#', '~', $matches[1]);

            return $model;
        }

        return null;
    }
294097
public function httpGet($url, $userAgent = null)
    {
        $ch = $this->commonCurlParams($url,$userAgent);

        // Setting the HTTP header with the Access Token only for Getting user info
        if ($this->header) {
            $this->headerArray[] = 'Authorization: bearer ' . $this->accessToken;
        }

        $response = $this->execute($ch);
        return $response;
    }