@@ 32-40 (lines=9) @@ | ||
29 | * @param UserAgent $userAgent |
|
30 | * @return bool |
|
31 | */ |
|
32 | private static function checkIpad(Device $device, UserAgent $userAgent) |
|
33 | { |
|
34 | if (stripos($userAgent->getUserAgentString(), 'ipad') !== false) { |
|
35 | $device->setName(Device::IPAD); |
|
36 | return true; |
|
37 | } |
|
38 | ||
39 | return false; |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * Determine if the device is iPhone. |
|
@@ 49-57 (lines=9) @@ | ||
46 | * @param UserAgent $userAgent |
|
47 | * @return bool |
|
48 | */ |
|
49 | private static function checkIphone(Device $device, UserAgent $userAgent) |
|
50 | { |
|
51 | if (stripos($userAgent->getUserAgentString(), 'iphone;') !== false) { |
|
52 | $device->setName(Device::IPHONE); |
|
53 | return true; |
|
54 | } |
|
55 | ||
56 | return false; |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * Determine if the device is Windows Phone. |
|
@@ 66-73 (lines=8) @@ | ||
63 | * @param UserAgent $userAgent |
|
64 | * @return bool |
|
65 | */ |
|
66 | private static function checkWindowsPhone(Device $device, UserAgent $userAgent) |
|
67 | { |
|
68 | if (stripos($userAgent->getUserAgentString(), 'Windows Phone') !== false) { |
|
69 | $device->setName($device::WINDOWS_PHONE); |
|
70 | return true; |
|
71 | } |
|
72 | return false; |
|
73 | } |
|
74 | } |
|
75 |