Get the robot name.
@param  string|null $userAgent
@return string|bool
182648
public function robot($userAgent = null)
    {
        if ($this->getCrawlerDetect()->isCrawler($userAgent ?: $this->userAgent)) {
            return ucfirst($this->getCrawlerDetect()->getMatches());
        }

        return false;
    }
375931
public function match($userAgentString)
    {
        foreach ($this->getValues() as $userAgentIdentifier) {
            if ($userAgentIdentifier === UserAgentDirective::DEFAULT_USER_AGENT) {
                continue;
            }

            if (substr_count($userAgentString, $userAgentIdentifier)) {
                return $userAgentIdentifier;
            }
        }

        return null;
    }
385715
public function applyConclusiveMatch($userAgent)
    {
        if (WURFL_Configuration_ConfigHolder::getWURFLConfig()->isHighPerformance()) {
            //High performance mode
            $tolerance = WURFL_Handlers_Utils::firstCloseParen($userAgent);
            return $this->getDeviceIDFromRIS($userAgent, $tolerance);
        } else {
            //High accuracy mode
            return $this->getDeviceIDFromLD($userAgent, 5);
        }
    }
127303
public function platform($userAgent = null)
    {
        // Get platform rules
        $rules = $this->mergeRules(
            static::$operatingSystems,
            static::$additionalOperatingSystems // NEW
        );

        return $this->findDetectionRulesAgainstUA($rules, $userAgent);
    }
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;
    }
913627
public static function getMobileCatchAllId($userAgent) {
		foreach (self::$mobileCatchAllIds as $key => $deviceId) {
			if (strpos($userAgent, $key) !== false) {
				return $deviceId;
			}
		}
		return WURFL_Constants::NO_MATCH;
	}
1235516
public function getDeviceForUserAgent($userAgent = '')
    {
        if (!is_string($userAgent)) {
            $userAgent = '';
        }

        $requestFactory = new Request\GenericRequestFactory();

        $request = $requestFactory->createRequestForUserAgent($userAgent);
        $device  = $this->getDeviceForRequest($request);

        return $device;
    }
1157032
public function normalize($userAgent)
    {
        // Normalize Android version
        $model   = AndroidHandler::getAndroidModel($userAgent, false);
        $version = AndroidHandler::getAndroidVersion($userAgent, false);
        if ($model !== null && $version !== null) {
            $prefix = $version . ' ' . $model . WurflConstants::RIS_DELIMITER;

            return $prefix . $userAgent;
        }

        return $userAgent;
    }
745099
public static function isSmartTV($userAgent) {
		if (self::$_is_smarttv !== null) return self::$_is_smarttv;
		self::$_is_smarttv = false;
		$userAgent = strtolower($userAgent);
		foreach (self::$smartTVBrowsers as $key) {
			if (strpos($userAgent, $key) !== false) {
				self::$_is_smarttv = true;
				break;
			}
		}
		return self::$_is_smarttv;
	}
1046513
public function applyConclusiveMatch($userAgent)
    {
        $matches = array();

        if (preg_match('#^Mozilla/5\.0 \(Windows NT.+? Edge/(\d+)\.(\d+)#', $userAgent, $matches)
            || preg_match('#^Mozilla/5\.0 \(.+?Trident.+?; rv:(\d\d)\.(\d+)\)#', $userAgent, $matches)
            || preg_match('#^Mozilla/[45]\.0 \(compatible; MSIE (\d+)\.(\d+);#', $userAgent, $matches)
        ) {
            $major = (int) $matches[1];
            $minor = (int) $matches[2];

            // MSIE 5.5 is handled specifically
            if ($major === 5 && $minor === 5) {
                return 'msie_5_5';
            }

            // Look for version in constant ID array
            if (array_key_exists($major, self::$constantIDs)) {
                return self::$constantIDs[$major];
            }
        }

        return $this->getDeviceIDFromRIS($userAgent, Utils::indexOfOrLength($userAgent, 'Trident'));
    }
898255
public static function getWindowsPhoneAdClientModel($userAgent)
    {
        // Normalize spaces in UA before capturing parts
        $userAgent = preg_replace('|;(?! )|', '; ', $userAgent);
        if (preg_match(
            '|Windows ?Phone ?Ad ?Client/[0-9\.]+ ?\(.+; ?Windows ?Phone(?: ?OS)? ?[0-9\.]+; ?([^;\)]+(; ?[^;\)]+)?)|',
            $userAgent,
            $matches
        )
        ) {
            $model = $matches[1];
            $model = str_replace('_blocked', '', $model);
            $model = preg_replace('/(NOKIA; RM-.+?)_.*/', '$1', $model, 1);
            $model = preg_replace('/(Microsoft; RM-.+?)_.*/', '$1', $model, 1);

            return $model;
        }

        return null;
    }
629866
public static function isSmartTV($userAgent)
    {
        if (self::$isSmartTv !== null) {
            return self::$isSmartTv;
        }
        self::$isSmartTv = false;
        $userAgent       = strtolower($userAgent);
        foreach (self::$smartTVBrowsers as $key) {
            if (strpos($userAgent, $key) !== false) {
                self::$isSmartTv = true;
                break;
            }
        }

        return self::$isSmartTv;
    }
893389
public function isPhone($userAgent = null)
    {
        if (null === $userAgent) {
            $this->init();
            $type = $this->type;
        } else {
            list($device, $type) = $this->determineDevice($userAgent);
        }

        return $type === 'phone';
    }
448366
public function normalize($userAgent)
    {
        $index = strpos($userAgent, 'UP.Link');

        if ($index !== false) {
            return substr($userAgent, 0, $index);
        }

        return $userAgent;
    }
606428
public function getMostSpecific(array $userAgents)
    {
        $array = [];
        foreach ($userAgents as $string) {
            // Strip non-US-ASCII characters
            $array[$string] = strtolower($this->strip($string));
        }
        foreach (array_map('strtolower', $this->getUserAgents()) as $generated) {
            if (($result = array_search($generated, $array)) !== false) {
                // Match found
                return $result;
            }
        }
        return false;
    }
833889
public function applyRecoveryMatch($userAgent)
    {
        foreach (self::$constantIDs as $keyword => $deviceId) {
            if (Utils::checkIfContains($userAgent, $keyword)) {
                return $deviceId;
            }
        }

        if (Utils::checkIfContains($userAgent, 'Opera Mobi')) {
            return 'generic_opera_mini_version4';
        }

        return 'generic_opera_mini_version1';
    }
546520
public function applyConclusiveMatch($userAgent)
    {
        $tolerance = Utils::toleranceToRisDelimeter($userAgent);
        if ($tolerance !== false) {
            return $this->getDeviceIDFromRIS($userAgent, $tolerance);
        }

        $operaMiniIndex = Utils::indexOfOrLength($userAgent, 'Opera Mini');

        if ($operaMiniIndex !== false) {
            // Match up to the first '.' after 'Opera Mini'
            $tolerance = strpos($userAgent, '.', $operaMiniIndex);

            if ($tolerance !== false) {
                // +1 to match just after the '.'
                return $this->getDeviceIDFromRIS($userAgent, $tolerance + 1);
            }
        }

        $tolerance = Utils::firstSlash($userAgent);

        return $this->getDeviceIDFromRIS($userAgent, $tolerance);
    }