diff --git a/src/ProxyCheck.php b/src/ProxyCheck.php index 1ee8d04..9c09348 100644 --- a/src/ProxyCheck.php +++ b/src/ProxyCheck.php @@ -108,14 +108,12 @@ protected function getProxyEnvConfig() */ protected function getProxyHeader() { - if (($this->proxyHeaderName === false) || (!isset($_SERVER[$this->proxyHeaderName])) || (empty($_SERVER[$this->proxyHeaderName]))) { + if (false === $this->proxyHeaderName || empty($_SERVER[$this->proxyHeaderName])) { return false; - } + } // Use PHP 5.3 compatible type casting - $proxyHeader = (string)$_SERVER[$this->proxyHeaderName]; - - return $proxyHeader; + return (string)$_SERVER[$this->proxyHeaderName]; } /** diff --git a/src/Request.php b/src/Request.php index 3384548..c6a5265 100644 --- a/src/Request.php +++ b/src/Request.php @@ -81,7 +81,7 @@ public static function getVar($name, $default = null, $hash = 'default', $type = { // Ensure hash and type are uppercase $hash = strtoupper($hash); - if ($hash === 'METHOD') { + if ('METHOD' === $hash) { $hash = static::getMethod(); } $type = strtoupper($type); @@ -123,10 +123,10 @@ public static function getVar($name, $default = null, $hash = 'default', $type = $var = static::stripSlashesRecursive($var); } } elseif (null !== $default) { - // Clean the default value - $var = static::cleanVar($default, $mask, $type); - } else { - $var = $default; + // Clean the default value + $var = static::cleanVar($default, $mask, $type); + } else { + $var = $default; } @@ -392,9 +392,9 @@ public static function hasVar($name, $hash = 'default') /** * Set a variable in one of the request variables * - * @param string $name Name - * @param string $value Value - * @param string $hash Hash + * @param string $name Name + * @param string $value Value + * @param string $hash Hash * @param bool $overwrite Boolean * * @return string Previous value @@ -517,8 +517,8 @@ public static function get($hash = 'default', $mask = 0) /** * Sets a request variable * - * @param array $array An associative array of key-value pairs - * @param string $hash The request variable to set (POST, GET, FILES, METHOD) + * @param array $array An associative array of key-value pairs + * @param string $hash The request variable to set (POST, GET, FILES, METHOD) * @param bool $overwrite If true and an existing key is found, the value is overwritten, * otherwise it is ignored *