@@ -97,7 +97,7 @@ |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | if (!empty($locale)) { |
100 | - return $userLanguage . $separator . strtoupper($locale); |
|
100 | + return $userLanguage.$separator.strtoupper($locale); |
|
101 | 101 | } else { |
102 | 102 | return $userLanguage; |
103 | 103 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | */ |
76 | 76 | public function setName($name) |
77 | 77 | { |
78 | - $this->name = (string)$name; |
|
78 | + $this->name = (string) $name; |
|
79 | 79 | |
80 | 80 | return $this; |
81 | 81 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function setUserAgentString($userAgentString) |
28 | 28 | { |
29 | - $this->userAgentString = (string)$userAgentString; |
|
29 | + $this->userAgentString = (string) $userAgentString; |
|
30 | 30 | |
31 | 31 | return $this; |
32 | 32 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function setName($name) |
89 | 89 | { |
90 | - $this->name = (string)$name; |
|
90 | + $this->name = (string) $name; |
|
91 | 91 | |
92 | 92 | return $this; |
93 | 93 | } |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | public function getVersion() |
101 | 101 | { |
102 | 102 | if (isset($this->version)) { |
103 | - return (string)$this->version; |
|
103 | + return (string) $this->version; |
|
104 | 104 | } else { |
105 | 105 | OsDetector::detect($this, $this->getUserAgent()); |
106 | 106 | |
107 | - return (string)$this->version; |
|
107 | + return (string) $this->version; |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function setVersion($version) |
119 | 119 | { |
120 | - $this->version = (string)$version; |
|
120 | + $this->version = (string) $version; |
|
121 | 121 | |
122 | 122 | return $this; |
123 | 123 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function setIsMobile($isMobile = true) |
153 | 153 | { |
154 | - $this->isMobile = (bool)$isMobile; |
|
154 | + $this->isMobile = (bool) $isMobile; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $os->setVersion('NT 4.0'); |
175 | 175 | break; |
176 | 176 | default: |
177 | - if ((float)$matches[1] >= 10.0) { |
|
177 | + if ((float) $matches[1] >= 10.0) { |
|
178 | 178 | $os->setVersion($matches[1]); |
179 | 179 | } |
180 | 180 | break; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | // Windows version |
227 | 227 | if (preg_match('/Windows Phone ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) { |
228 | 228 | if (isset($matches[1])) { |
229 | - $os->setVersion((float)$matches[1]); |
|
229 | + $os->setVersion((float) $matches[1]); |
|
230 | 230 | } |
231 | 231 | } |
232 | 232 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | $aresult = explode('Version/10.', $userAgent->getUserAgentString()); |
316 | 316 | if (isset($aresult[1])) { |
317 | 317 | $aversion = explode(' ', $aresult[1]); |
318 | - $os->setVersion('10.' . $aversion[0]); |
|
318 | + $os->setVersion('10.'.$aversion[0]); |
|
319 | 319 | } else { |
320 | 320 | $os->setVersion('10'); |
321 | 321 | } |
@@ -273,8 +273,8 @@ discard block |
||
273 | 273 | } |
274 | 274 | |
275 | 275 | /** |
276 | - * @param bool $isChromeFrame |
|
277 | 276 | * |
277 | + * @param boolean $isWebkit |
|
278 | 278 | * @return $this |
279 | 279 | */ |
280 | 280 | public function setIsWebkit($isWebkit) |
@@ -396,6 +396,7 @@ discard block |
||
396 | 396 | |
397 | 397 | /** |
398 | 398 | * @param bool |
399 | + * @param boolean $isCompatibilityMode |
|
399 | 400 | * |
400 | 401 | * @return $this |
401 | 402 | */ |
@@ -226,13 +226,11 @@ |
||
226 | 226 | if ($scriptedAgent->getName()==ScriptedAgent::UNKNOWN) |
227 | 227 | { |
228 | 228 | return false; |
229 | - } |
|
230 | - else |
|
229 | + } else |
|
231 | 230 | { |
232 | 231 | return $scriptedAgent; |
233 | 232 | } |
234 | - } |
|
235 | - else |
|
233 | + } else |
|
236 | 234 | { |
237 | 235 | return false; |
238 | 236 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function setName($name) |
116 | 116 | { |
117 | - $this->name = (string)$name; |
|
117 | + $this->name = (string) $name; |
|
118 | 118 | |
119 | 119 | return $this; |
120 | 120 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function setVersion($version) |
156 | 156 | { |
157 | - $this->version = (string)$version; |
|
157 | + $this->version = (string) $version; |
|
158 | 158 | |
159 | 159 | return $this; |
160 | 160 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | ) |
223 | 223 | { |
224 | 224 | $scriptedAgent = new ScriptedAgent($ua); |
225 | - if ($scriptedAgent->getName()==ScriptedAgent::UNKNOWN) |
|
225 | + if ($scriptedAgent->getName() == ScriptedAgent::UNKNOWN) |
|
226 | 226 | { |
227 | 227 | return false; |
228 | 228 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function setIsChromeFrame($isChromeFrame) |
246 | 246 | { |
247 | - $this->isChromeFrame = (bool)$isChromeFrame; |
|
247 | + $this->isChromeFrame = (bool) $isChromeFrame; |
|
248 | 248 | |
249 | 249 | return $this; |
250 | 250 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public function setIsWebkit($isWebkit) |
280 | 280 | { |
281 | - $this->isWebkit = (bool)$isWebkit; |
|
281 | + $this->isWebkit = (bool) $isWebkit; |
|
282 | 282 | |
283 | 283 | return $this; |
284 | 284 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | self::$scriptedAgent->setInfoURL(ScriptedAgent::UNKNOWN); |
76 | 76 | |
77 | 77 | foreach (self::$robotsList as $robotName) { |
78 | - $funcName = self::FUNC_PREFIX . $robotName; |
|
78 | + $funcName = self::FUNC_PREFIX.$robotName; |
|
79 | 79 | |
80 | 80 | if (self::$funcName()) { |
81 | 81 | return true; |
@@ -429,9 +429,11 @@ |
||
429 | 429 | public static function checkRobotWebdav() |
430 | 430 | { |
431 | 431 | if (stripos(self::$userAgentString, "WEBDAV Client") !== false || |
432 | - stripos(self::$userAgentString, "Microsoft Office Existence Discovery") !== false) //Office Webdav probe |
|
432 | + stripos(self::$userAgentString, "Microsoft Office Existence Discovery") !== false) { |
|
433 | + //Office Webdav probe |
|
433 | 434 | { |
434 | 435 | self::$scriptedAgent->setName(ScriptedAgent::WEBDAV); |
436 | + } |
|
435 | 437 | self::$scriptedAgent->setType(ScriptedAgent::TOOL); |
436 | 438 | self::$scriptedAgent->setInfoURL("https://en.wikipedia.org/wiki/WebDAV"); |
437 | 439 | return true; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function setName($name) |
102 | 102 | { |
103 | - $this->name = (string)$name; |
|
103 | + $this->name = (string) $name; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function setType($type) |
128 | 128 | { |
129 | - $this->type = (string)$type; |
|
129 | + $this->type = (string) $type; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function setInfoURL($url) |
154 | 154 | { |
155 | - $this->url = (string)$url; |
|
155 | + $this->url = (string) $url; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | self::checkWebkit(); |
97 | 97 | |
98 | 98 | foreach (self::$browsersList as $browserName) { |
99 | - $funcName = self::FUNC_PREFIX . $browserName; |
|
99 | + $funcName = self::FUNC_PREFIX.$browserName; |
|
100 | 100 | |
101 | 101 | if (self::$funcName()) { |
102 | 102 | return true; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $aresult = explode('Version/10.', self::$userAgentString); |
201 | 201 | if (isset($aresult[1])) { |
202 | 202 | $aversion = explode(' ', $aresult[1]); |
203 | - self::$browser->setVersion('10.' . $aversion[0]); |
|
203 | + self::$browser->setVersion('10.'.$aversion[0]); |
|
204 | 204 | } |
205 | 205 | self::$browser->setName(Browser::BLACKBERRY); |
206 | 206 | return true; |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | if (stripos(self::$userAgentString, 'Edge') !== false) { |
476 | 476 | $version = explode('Edge/', self::$userAgentString); |
477 | 477 | if (isset($version[1])) { |
478 | - self::$browser->setVersion((float)$version[1]); |
|
478 | + self::$browser->setVersion((float) $version[1]); |
|
479 | 479 | } |
480 | 480 | self::$browser->setName(Browser::EDGE); |
481 | 481 |