Skip to content

Commit

Permalink
Fixed codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Shevchuk authored and Anton Shevchuk committed Jul 6, 2017
1 parent 8bfc97b commit 73e7e96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Controller/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public function setMethod($method)
/**
* Get all params
*
* @return array|null
* @return array
*/
public function getParams()
{
Expand Down Expand Up @@ -418,7 +418,7 @@ protected function initRoute()
*
* @return string
*/
protected function prepareRoutePattern($route)
protected function prepareRoutePattern($route): string
{
$pattern = str_replace('/', '\/', $route);

Expand Down
20 changes: 10 additions & 10 deletions src/Proxy/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public static function getFile($name)
*/
public static function getClientIp($checkProxy = true)
{
$result = null;
if ($checkProxy) {
$result = self::getServer('HTTP_CLIENT_IP') ?? self::getServer('HTTP_X_FORWARDED_FOR') ?? null;
}
Expand Down Expand Up @@ -245,17 +246,16 @@ public static function getMethod(): string
*/
public static function getAccept(): array
{

if (!static::$accept) {
if (!self::$accept) {
// save to static variable
static::$accept = [];
self::$accept = [];

// get header from request
$header = self::getHeader('accept');

// nothing ...
if (!$header) {
return static::$accept;
return self::$accept;
}

// make array if types
Expand All @@ -277,11 +277,11 @@ public static function getAccept(): array

// mime-type $a is accepted with the quality $q
// WARNING: $q == 0 means, that mime-type isn’t supported!
static::$accept[$a] = (float)$q;
self::$accept[$a] = (float)$q;
}
arsort(static::$accept);
arsort(self::$accept);
}
return static::$accept;
return self::$accept;
}

/**
Expand All @@ -291,15 +291,15 @@ public static function getAccept(): array
*/
public static function resetAccept()
{
static::$accept = null;
self::$accept = null;
}

/**
* Check Accept header
*
* @param array $allowTypes
*
* @return string
* @return string|false
*/
public static function checkAccept(array $allowTypes = [])
{
Expand All @@ -319,7 +319,7 @@ public static function checkAccept(array $allowTypes = [])
}
}
// no mime-type found
return null;
return false;
}

/**
Expand Down

0 comments on commit 73e7e96

Please sign in to comment.