/**
  * @param null|Device $device
  *
  * @throws \Browser\InvalidArgumentException
  */
 public function detect(Device $device)
 {
     $this->device = $device;
     if (!$this->userAgent instanceof UserAgent) {
         $this->userAgent = new UserAgent();
         $this->userAgent->createUserAgentString();
     }
     $this->checkIpad() || $this->checkIphone();
     $this->device->setIsDetected(true);
 }
Beispiel #2
0
 /**
  * @param Device $device
  * @throws InvalidArgumentException
  */
 public function detect(Device $device = null)
 {
     if (null !== $device) {
         $this->device = $device;
     }
     if (!$this->device instanceof Device) {
         throw new InvalidArgumentException();
     }
     if (!$this->userAgent instanceof UserAgent) {
         $this->userAgent = new UserAgent();
         $this->userAgent->createUserAgentString();
     }
     $this->checkIpad();
     $this->device->setIsDetected(true);
 }