@@ -88,7 +88,6 @@ class Browser
88
88
89
89
/**
90
90
* @param null|string|UserAgent $userAgent
91
- *
92
91
* @throws \Sinergi\BrowserDetector\InvalidArgumentException
93
92
*/
94
93
public function __construct ($ userAgent = null )
@@ -106,13 +105,11 @@ public function __construct($userAgent = null)
106
105
* Set the name of the Browser.
107
106
*
108
107
* @param string $name
109
- *
110
108
* @return $this
111
109
*/
112
110
public function setName ($ name )
113
111
{
114
112
$ this ->name = (string )$ name ;
115
-
116
113
return $ this ;
117
114
}
118
115
@@ -134,7 +131,6 @@ public function getName()
134
131
* Check to see if the specific browser is valid.
135
132
*
136
133
* @param string $name
137
- *
138
134
* @return bool
139
135
*/
140
136
public function isBrowser ($ name )
@@ -146,13 +142,11 @@ public function isBrowser($name)
146
142
* Set the version of the browser.
147
143
*
148
144
* @param string $version
149
- *
150
145
* @return $this
151
146
*/
152
147
public function setVersion ($ version )
153
148
{
154
149
$ this ->version = (string )$ version ;
155
-
156
150
return $ this ;
157
151
}
158
152
@@ -216,33 +210,25 @@ public function detectScriptedAgent()
216
210
stripos ($ ua , 'Google Web Preview ' ) !== FALSE ||
217
211
stripos ($ ua , 'ips-agent ' ) !== FALSE ||
218
212
(stripos ($ ua , 'Chrome/51.0.2704.103 ' ) !== FALSE && !isset ($ _SERVER ['HTTP_UPGRADE_INSECURE_REQUESTS ' ]) && stristr ($ _SERVER ['HTTP_ACCEPT_LANGUAGE ' ], "ru-RU " ) !== FALSE ) //ICQ Preview
219
- )
220
- {
213
+ ) {
221
214
$ scriptedAgent = new ScriptedAgent ($ ua );
222
- if ($ scriptedAgent ->getName ()==ScriptedAgent::UNKNOWN )
223
- {
215
+ if ($ scriptedAgent ->getName ()==ScriptedAgent::UNKNOWN ) {
224
216
return false ;
225
- }
226
- else
227
- {
217
+ } else {
228
218
return $ scriptedAgent ;
229
219
}
230
- }
231
- else
232
- {
220
+ } else {
233
221
return false ;
234
222
}
235
223
}
236
224
237
225
/**
238
226
* @param bool $isChromeFrame
239
- *
240
227
* @return $this
241
228
*/
242
229
public function setIsChromeFrame ($ isChromeFrame )
243
230
{
244
231
$ this ->isChromeFrame = (bool )$ isChromeFrame ;
245
-
246
232
return $ this ;
247
233
}
248
234
@@ -269,14 +255,12 @@ public function isChromeFrame()
269
255
}
270
256
271
257
/**
272
- * @param bool $isChromeFrame
273
- *
258
+ * @param bool $isWebkit
274
259
* @return $this
275
260
*/
276
261
public function setIsWebkit ($ isWebkit )
277
262
{
278
263
$ this ->isWebkit = (bool )$ isWebkit ;
279
-
280
264
return $ this ;
281
265
}
282
266
@@ -304,13 +288,11 @@ public function isWebkit()
304
288
305
289
/**
306
290
* @param bool $isFacebookWebView
307
- *
308
291
* @return $this
309
292
*/
310
293
public function setIsFacebookWebView ($ isFacebookWebView )
311
294
{
312
295
$ this ->isFacebookWebView = (bool ) $ isFacebookWebView ;
313
-
314
296
return $ this ;
315
297
}
316
298
@@ -338,13 +320,11 @@ public function isFacebookWebView()
338
320
339
321
/**
340
322
* @param bool $isTwitterWebView
341
- *
342
323
* @return $this
343
324
*/
344
325
public function setIsTwitterWebView ($ isTwitterWebView )
345
326
{
346
327
$ this ->isTwitterWebView = (bool ) $ isTwitterWebView ;
347
-
348
328
return $ this ;
349
329
}
350
330
@@ -372,13 +352,11 @@ public function isTwitterWebView()
372
352
373
353
/**
374
354
* @param UserAgent $userAgent
375
- *
376
355
* @return $this
377
356
*/
378
357
public function setUserAgent (UserAgent $ userAgent )
379
358
{
380
359
$ this ->userAgent = $ userAgent ;
381
-
382
360
return $ this ;
383
361
}
384
362
@@ -398,7 +376,6 @@ public function getUserAgent()
398
376
public function setIsCompatibilityMode ($ isCompatibilityMode )
399
377
{
400
378
$ this ->isCompatibilityMode = $ isCompatibilityMode ;
401
-
402
379
return $ this ;
403
380
}
404
381
0 commit comments