1 | <?php |
||
17 | class Result implements \JsonSerializable |
||
18 | { |
||
19 | /** |
||
20 | * Get User Agent |
||
21 | * @return string |
||
22 | */ |
||
23 | public function getUserAgent(): string |
||
27 | |||
28 | /** @var string UserAgent */ |
||
29 | protected $userAgent = null; |
||
30 | |||
31 | /** |
||
32 | * @var Os Result of os detection |
||
33 | */ |
||
34 | protected $os; |
||
35 | /** |
||
36 | * @var Browser Result of browser detection |
||
37 | */ |
||
38 | protected $browser; |
||
39 | /** |
||
40 | * @var Device Result of device detection |
||
41 | */ |
||
42 | protected $device; |
||
43 | /** |
||
44 | * @var Robot Result of robot detection |
||
45 | */ |
||
46 | protected $robot; |
||
47 | |||
48 | /** |
||
49 | * @var boolean true if user is robot |
||
50 | */ |
||
51 | protected $isRobot = false; |
||
52 | |||
53 | /** |
||
54 | * @var boolean true if device is touch |
||
55 | */ |
||
56 | protected $isTouch = false; |
||
57 | /** |
||
58 | * @var boolean true if device is mobile |
||
59 | */ |
||
60 | protected $isMobile = false; |
||
61 | |||
62 | /** |
||
63 | * True if user is robot |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function isRobot(): bool |
||
70 | |||
71 | /** |
||
72 | * Setter |
||
73 | * @param bool $isRobot |
||
74 | */ |
||
75 | public function setIsRobot(bool $isRobot) |
||
79 | |||
80 | /** |
||
81 | * True if user is touch |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function isTouch(): bool |
||
88 | |||
89 | /** |
||
90 | * Setter |
||
91 | * @param bool $isTouch |
||
92 | */ |
||
93 | public function setIsTouch(bool $isTouch) |
||
97 | |||
98 | /** |
||
99 | * True if user is mobile |
||
100 | * @return bool |
||
101 | */ |
||
102 | public function isMobile(): bool |
||
106 | |||
107 | /** |
||
108 | * Setter |
||
109 | * @param bool $isMobile |
||
110 | */ |
||
111 | public function setIsMobile(bool $isMobile) |
||
115 | |||
116 | /** |
||
117 | * True if user is tablet |
||
118 | * @return bool |
||
119 | */ |
||
120 | public function isTablet(): bool |
||
124 | |||
125 | /** |
||
126 | * Setter |
||
127 | * @param bool $isTablet |
||
128 | */ |
||
129 | public function setIsTablet(bool $isTablet) |
||
133 | |||
134 | /** @var boolean true if user is tablet */ |
||
135 | protected $isTablet = false; |
||
136 | |||
137 | /** |
||
138 | * Result constructor. |
||
139 | * @param string $userAgent User Agent |
||
140 | */ |
||
141 | public function __construct(string $userAgent) |
||
149 | |||
150 | /** |
||
151 | * Get result of os detection |
||
152 | * @return Os |
||
153 | */ |
||
154 | public function getOs(): Os |
||
158 | |||
159 | /** |
||
160 | * Get result of browser detection |
||
161 | * @return Browser |
||
162 | */ |
||
163 | public function getBrowser(): Browser |
||
167 | |||
168 | /** |
||
169 | * Get result of device detection |
||
170 | * @return Device |
||
171 | */ |
||
172 | public function getDevice(): Device |
||
176 | |||
177 | /** |
||
178 | * Get result of robot detection |
||
179 | * @return Robot |
||
180 | */ |
||
181 | public function getRobot(): Robot |
||
185 | |||
186 | public function jsonSerialize() |
||
190 | } |