UserAgentParser\Model\UserAgent::getBrowser PHP Method

getBrowser() public method

public getBrowser ( ) : Browser
return Browser
    public function getBrowser()
    {
        return $this->browser;
    }

Usage Example

 public function parse($userAgent, array $headers = [])
 {
     $resultRaw = parse_user_agent($userAgent);
     if ($this->hasResult($resultRaw) !== true) {
         throw new Exception\NoResultFoundException('No result found for user agent: ' . $userAgent);
     }
     /*
      * Hydrate the model
      */
     $result = new Model\UserAgent();
     $result->setProviderResultRaw($resultRaw);
     /*
      * Bot detection - is currently not possible!
      */
     /*
      * hydrate the result
      */
     $this->hydrateBrowser($result->getBrowser(), $resultRaw);
     // renderingEngine not available
     // os is mixed with device informations
     // device is mixed with os
     return $result;
 }
All Usage Examples Of UserAgentParser\Model\UserAgent::getBrowser