@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @var array |
29 | 29 | */ |
30 | - protected static $headers =[ |
|
30 | + protected static $headers = [ |
|
31 | 31 | 'content-type' => ContentTypeItem::class, |
32 | 32 | ]; |
33 | 33 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if ($value instanceof HeaderItem) { |
70 | 70 | $header = $value; |
71 | 71 | } elseif (array_key_exists($name, static::$headers)) { |
72 | - $class =static::$headers[$name]; |
|
72 | + $class = static::$headers[$name]; |
|
73 | 73 | $header = new $class($name, $value); |
74 | 74 | } else { |
75 | 75 | $header = new HeaderItem($name, $value); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @param mixed $default |
60 | 60 | * @return mixed |
61 | 61 | */ |
62 | - public function getHeader(string $name, $default =null) { |
|
62 | + public function getHeader(string $name, $default = null) { |
|
63 | 63 | if (array_key_exists(strtolower($name), $this->headers)) { |
64 | 64 | return $this->headers[$name]; |
65 | 65 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function ip() |
85 | 85 | { |
86 | - static $ipFrom = ['HTTP_CLIENT_IP','HTTP_X_FORWARDED_FOR','HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP','HTTP_FORWARDED_FOR','HTTP_FORWARDED','REMOTE_ADDR']; |
|
86 | + static $ipFrom = ['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR']; |
|
87 | 87 | foreach ($ipFrom as $key) { |
88 | 88 | if (array_key_exists($key, $_SERVER)) { |
89 | 89 | foreach (explode(',', $_SERVER[$key]) as $ip) { |