コード例 #1
0
 /**
  * Determine if the device is Iphone.
  *
  * @return bool
  */
 public function checkIphone()
 {
     if (stripos($this->userAgent->getUserAgentString(), 'iphone;') !== false) {
         $this->device->setName(Device::IPHONE);
         return true;
     }
     return false;
 }
コード例 #2
0
 /**
  * Determine if the device is Windows Phone.
  *
  * @param Device $device
  * @param UserAgent $userAgent
  * @return bool
  */
 private static function checkWindowsPhone(Device $device, UserAgent $userAgent)
 {
     if (stripos($userAgent->getUserAgentString(), 'Windows Phone') !== false) {
         $device->setName($device::WINDOWS_PHONE);
         return true;
     }
     return false;
 }