From 90bbc91826aa74fd008b7c6e58ed9674eaea5183 Mon Sep 17 00:00:00 2001 From: Gabriel Bull Date: Tue, 11 Apr 2017 21:55:33 -0400 Subject: [PATCH] Few style changes --- src/Browser.php | 33 +++++---------------------------- src/BrowserDetector.php | 2 -- src/ScriptedAgentDetector.php | 2 +- 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/src/Browser.php b/src/Browser.php index 3340f4c..0e190cc 100644 --- a/src/Browser.php +++ b/src/Browser.php @@ -88,7 +88,6 @@ class Browser /** * @param null|string|UserAgent $userAgent - * * @throws \Sinergi\BrowserDetector\InvalidArgumentException */ public function __construct($userAgent = null) @@ -106,13 +105,11 @@ public function __construct($userAgent = null) * Set the name of the Browser. * * @param string $name - * * @return $this */ public function setName($name) { $this->name = (string)$name; - return $this; } @@ -134,7 +131,6 @@ public function getName() * Check to see if the specific browser is valid. * * @param string $name - * * @return bool */ public function isBrowser($name) @@ -146,13 +142,11 @@ public function isBrowser($name) * Set the version of the browser. * * @param string $version - * * @return $this */ public function setVersion($version) { $this->version = (string)$version; - return $this; } @@ -216,33 +210,25 @@ public function detectScriptedAgent() stripos($ua, 'Google Web Preview') !== FALSE || stripos($ua, 'ips-agent') !== FALSE || (stripos($ua, 'Chrome/51.0.2704.103') !== FALSE && !isset($_SERVER['HTTP_UPGRADE_INSECURE_REQUESTS']) && stristr($_SERVER['HTTP_ACCEPT_LANGUAGE'], "ru-RU") !== FALSE) //ICQ Preview - ) - { + ) { $scriptedAgent = new ScriptedAgent($ua); - if ($scriptedAgent->getName()==ScriptedAgent::UNKNOWN) - { + if ($scriptedAgent->getName()==ScriptedAgent::UNKNOWN) { return false; - } - else - { + } else { return $scriptedAgent; } - } - else - { + } else { return false; } } /** * @param bool $isChromeFrame - * * @return $this */ public function setIsChromeFrame($isChromeFrame) { $this->isChromeFrame = (bool)$isChromeFrame; - return $this; } @@ -269,14 +255,12 @@ public function isChromeFrame() } /** - * @param bool $isChromeFrame - * + * @param bool $isWebkit * @return $this */ public function setIsWebkit($isWebkit) { $this->isWebkit = (bool)$isWebkit; - return $this; } @@ -304,13 +288,11 @@ public function isWebkit() /** * @param bool $isFacebookWebView - * * @return $this */ public function setIsFacebookWebView($isFacebookWebView) { $this->isFacebookWebView = (bool) $isFacebookWebView; - return $this; } @@ -338,13 +320,11 @@ public function isFacebookWebView() /** * @param bool $isTwitterWebView - * * @return $this */ public function setIsTwitterWebView($isTwitterWebView) { $this->isTwitterWebView = (bool) $isTwitterWebView; - return $this; } @@ -372,13 +352,11 @@ public function isTwitterWebView() /** * @param UserAgent $userAgent - * * @return $this */ public function setUserAgent(UserAgent $userAgent) { $this->userAgent = $userAgent; - return $this; } @@ -398,7 +376,6 @@ public function getUserAgent() public function setIsCompatibilityMode($isCompatibilityMode) { $this->isCompatibilityMode = $isCompatibilityMode; - return $this; } diff --git a/src/BrowserDetector.php b/src/BrowserDetector.php index 7fef018..8cbc1ba 100644 --- a/src/BrowserDetector.php +++ b/src/BrowserDetector.php @@ -170,8 +170,6 @@ public static function checkTwitterWebView() return false; } - - /** * Determine if the user is using a BlackBerry. * diff --git a/src/ScriptedAgentDetector.php b/src/ScriptedAgentDetector.php index 2cd6d84..ed8bf98 100644 --- a/src/ScriptedAgentDetector.php +++ b/src/ScriptedAgentDetector.php @@ -55,7 +55,7 @@ class ScriptedAgentDetector implements DetectorInterface ); /** - * Routine to determine the browser type. + * Routine to determine the scripted agent type. * * @param ScriptedAgent $scriptedAgent * @param UserAgent $userAgent