Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 90bbc91

Browse files
committed
Few style changes
1 parent 242c2d7 commit 90bbc91

File tree

3 files changed

+6
-31
lines changed

3 files changed

+6
-31
lines changed

src/Browser.php

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class Browser
8888

8989
/**
9090
* @param null|string|UserAgent $userAgent
91-
*
9291
* @throws \Sinergi\BrowserDetector\InvalidArgumentException
9392
*/
9493
public function __construct($userAgent = null)
@@ -106,13 +105,11 @@ public function __construct($userAgent = null)
106105
* Set the name of the Browser.
107106
*
108107
* @param string $name
109-
*
110108
* @return $this
111109
*/
112110
public function setName($name)
113111
{
114112
$this->name = (string)$name;
115-
116113
return $this;
117114
}
118115

@@ -134,7 +131,6 @@ public function getName()
134131
* Check to see if the specific browser is valid.
135132
*
136133
* @param string $name
137-
*
138134
* @return bool
139135
*/
140136
public function isBrowser($name)
@@ -146,13 +142,11 @@ public function isBrowser($name)
146142
* Set the version of the browser.
147143
*
148144
* @param string $version
149-
*
150145
* @return $this
151146
*/
152147
public function setVersion($version)
153148
{
154149
$this->version = (string)$version;
155-
156150
return $this;
157151
}
158152

@@ -216,33 +210,25 @@ public function detectScriptedAgent()
216210
stripos($ua, 'Google Web Preview') !== FALSE ||
217211
stripos($ua, 'ips-agent') !== FALSE ||
218212
(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+
) {
221214
$scriptedAgent = new ScriptedAgent($ua);
222-
if ($scriptedAgent->getName()==ScriptedAgent::UNKNOWN)
223-
{
215+
if ($scriptedAgent->getName()==ScriptedAgent::UNKNOWN) {
224216
return false;
225-
}
226-
else
227-
{
217+
} else {
228218
return $scriptedAgent;
229219
}
230-
}
231-
else
232-
{
220+
} else {
233221
return false;
234222
}
235223
}
236224

237225
/**
238226
* @param bool $isChromeFrame
239-
*
240227
* @return $this
241228
*/
242229
public function setIsChromeFrame($isChromeFrame)
243230
{
244231
$this->isChromeFrame = (bool)$isChromeFrame;
245-
246232
return $this;
247233
}
248234

@@ -269,14 +255,12 @@ public function isChromeFrame()
269255
}
270256

271257
/**
272-
* @param bool $isChromeFrame
273-
*
258+
* @param bool $isWebkit
274259
* @return $this
275260
*/
276261
public function setIsWebkit($isWebkit)
277262
{
278263
$this->isWebkit = (bool)$isWebkit;
279-
280264
return $this;
281265
}
282266

@@ -304,13 +288,11 @@ public function isWebkit()
304288

305289
/**
306290
* @param bool $isFacebookWebView
307-
*
308291
* @return $this
309292
*/
310293
public function setIsFacebookWebView($isFacebookWebView)
311294
{
312295
$this->isFacebookWebView = (bool) $isFacebookWebView;
313-
314296
return $this;
315297
}
316298

@@ -338,13 +320,11 @@ public function isFacebookWebView()
338320

339321
/**
340322
* @param bool $isTwitterWebView
341-
*
342323
* @return $this
343324
*/
344325
public function setIsTwitterWebView($isTwitterWebView)
345326
{
346327
$this->isTwitterWebView = (bool) $isTwitterWebView;
347-
348328
return $this;
349329
}
350330

@@ -372,13 +352,11 @@ public function isTwitterWebView()
372352

373353
/**
374354
* @param UserAgent $userAgent
375-
*
376355
* @return $this
377356
*/
378357
public function setUserAgent(UserAgent $userAgent)
379358
{
380359
$this->userAgent = $userAgent;
381-
382360
return $this;
383361
}
384362

@@ -398,7 +376,6 @@ public function getUserAgent()
398376
public function setIsCompatibilityMode($isCompatibilityMode)
399377
{
400378
$this->isCompatibilityMode = $isCompatibilityMode;
401-
402379
return $this;
403380
}
404381

src/BrowserDetector.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ public static function checkTwitterWebView()
170170
return false;
171171
}
172172

173-
174-
175173
/**
176174
* Determine if the user is using a BlackBerry.
177175
*

src/ScriptedAgentDetector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ScriptedAgentDetector implements DetectorInterface
5555
);
5656

5757
/**
58-
* Routine to determine the browser type.
58+
* Routine to determine the scripted agent type.
5959
*
6060
* @param ScriptedAgent $scriptedAgent
6161
* @param UserAgent $userAgent

0 commit comments

Comments
 (0)