src/Agent.php
protected function findDetectionRulesAgainstUA(array $rules, $userAgent = null)
    {
        // Loop given rules
        foreach ($rules as $key => $regex) {
            if (empty($regex)) {
                continue;
            }

            // Check match
            if ($this->match($regex, $userAgent)) {
                return $key ?: reset($this->matchesArray);
            }
        }

        return false;
    }
protected function findDetectionRulesAgainstUA(array $rules, $userAgent = null)
    {
        // Loop given rules
        foreach ($rules as $key => $regex) {
            if (empty($regex)) {
                continue;
            }

            // Check match
            if ($this->match($regex, $userAgent)) {
                return $key ?: reset($this->matchesArray);
            }
        }

        return false;
    }
protected function findDetectionRulesAgainstUA ( array $ rules , $ userAgent = null ) { // Loop given rules foreach ( $ rules as $ key => $ regex ) { if ( empty ( $ regex ) ) { continue ; } // Check match if ( $ this -> match ( $ regex , $ userAgent ) ) { return $ key ? : reset ( $ this -> matchesArray ) ; } } return false ; }
Match a detection rule and return the matched key.
@param  array $rules
@param  string|null $userAgent
@return string
Match a detection rule and return the matched key .