src/CrawlerDetect.php
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;
    }
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;
    }
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 ; }
Set the user agent.

@param string $userAgent
Set the user agent .