src/CrawlerDetect.php
public function isCrawler($userAgent = null)
    {
        $agent = trim(preg_replace(
            "/{$this->compiledExclusions}/i",
            '',
            $userAgent ?: $this->userAgent
        ));

        if ($agent == '') {
            return false;
        }

        $result = preg_match("/{$this->compiledRegex}/i", $agent, $matches);

        if ($matches) {
            $this->matches = $matches;
        }

        return (bool) $result;
    }
public function isCrawler($userAgent = null)
    {
        $agent = trim(preg_replace(
            "/{$this->compiledExclusions}/i",
            '',
            $userAgent ?: $this->userAgent
        ));

        if ($agent == '') {
            return false;
        }

        $result = preg_match("/{$this->compiledRegex}/i", $agent, $matches);

        if ($matches) {
            $this->matches = $matches;
        }

        return (bool) $result;
    }
public function isCrawler ( $ userAgent = null ) { $ agent = trim ( preg_replace ( "/{$this->compiledExclusions}/i" , '' , $ userAgent ? : $ this -> userAgent ) ) ; if ( $ agent == '' ) { return false ; } $ result = preg_match ( "/{$this->compiledRegex}/i" , $ agent , $ matches ) ; if ( $ matches ) { $ this -> matches = $ matches ; } return ( bool ) $ result ; }
Check user agent string against the regex.

@param string|null $userAgent

@return bool
Check user agent string against the regex .