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

Commit

Permalink
Few style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbull committed Apr 12, 2017
1 parent 242c2d7 commit 90bbc91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 31 deletions.
33 changes: 5 additions & 28 deletions src/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class Browser

/**
* @param null|string|UserAgent $userAgent
*
* @throws \Sinergi\BrowserDetector\InvalidArgumentException
*/
public function __construct($userAgent = null)
Expand All @@ -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;
}

Expand All @@ -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)
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -304,13 +288,11 @@ public function isWebkit()

/**
* @param bool $isFacebookWebView
*
* @return $this
*/
public function setIsFacebookWebView($isFacebookWebView)
{
$this->isFacebookWebView = (bool) $isFacebookWebView;

return $this;
}

Expand Down Expand Up @@ -338,13 +320,11 @@ public function isFacebookWebView()

/**
* @param bool $isTwitterWebView
*
* @return $this
*/
public function setIsTwitterWebView($isTwitterWebView)
{
$this->isTwitterWebView = (bool) $isTwitterWebView;

return $this;
}

Expand Down Expand Up @@ -372,13 +352,11 @@ public function isTwitterWebView()

/**
* @param UserAgent $userAgent
*
* @return $this
*/
public function setUserAgent(UserAgent $userAgent)
{
$this->userAgent = $userAgent;

return $this;
}

Expand All @@ -398,7 +376,6 @@ public function getUserAgent()
public function setIsCompatibilityMode($isCompatibilityMode)
{
$this->isCompatibilityMode = $isCompatibilityMode;

return $this;
}

Expand Down
2 changes: 0 additions & 2 deletions src/BrowserDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ public static function checkTwitterWebView()
return false;
}



/**
* Determine if the user is using a BlackBerry.
*
Expand Down
2 changes: 1 addition & 1 deletion src/ScriptedAgentDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90bbc91

Please sign in to comment.