@@ -64,7 +64,7 @@ |
||
| 64 | 64 | 'REMOTE_ADDR' => '127.0.0.1', |
| 65 | 65 | 'SERVER_PROTOCOL' => 'HTTP/1.1', |
| 66 | 66 | 'REQUEST_TIME' => time(), |
| 67 | - 'REQUEST_URI' => (string)$uri, |
|
| 67 | + 'REQUEST_URI' => (string) $uri, |
|
| 68 | 68 | 'REQUEST_METHOD' => $method |
| 69 | 69 | ], $_SERVER); |
| 70 | 70 | |
@@ -39,8 +39,6 @@ |
||
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * ServerRequest constructor. |
| 42 | - * @param string $uri |
|
| 43 | - * @param string $method |
|
| 44 | 42 | * @param array $server |
| 45 | 43 | */ |
| 46 | 44 | public function __construct($server = []) |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | namespace Fyuze\Http\Message; |
| 3 | 3 | |
| 4 | 4 | use Psr\Http\Message\ServerRequestInterface; |
| 5 | -use Psr\Http\Message\UriInterface; |
|
| 6 | 5 | |
| 7 | 6 | class ServerRequest extends Request implements ServerRequestInterface |
| 8 | 7 | { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | foreach (new GlobIterator($this->path . '/*.*') as $file) { |
| 99 | 99 | |
| 100 | - if($config = $this->getType($file)) { |
|
| 100 | + if ($config = $this->getType($file)) { |
|
| 101 | 101 | $this->configs[$config[0]] = $config[1]; |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $extension = $file->getExtension(); |
| 113 | 113 | $name = $file->getBasename(".$extension"); |
| 114 | 114 | |
| 115 | - $type = array_filter($this->types, function ($n) use ($extension) { |
|
| 115 | + $type = array_filter($this->types, function($n) use ($extension) { |
|
| 116 | 116 | return in_array($extension, $n::$extensions); |
| 117 | 117 | }); |
| 118 | 118 | |
@@ -41,9 +41,9 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | protected function match(ServerRequestInterface $request) |
| 43 | 43 | { |
| 44 | - return array_filter($this->routes->getRoutes(), function (Route $route) use ($request) { |
|
| 44 | + return array_filter($this->routes->getRoutes(), function(Route $route) use ($request) { |
|
| 45 | 45 | $match = $route->matches($request); |
| 46 | - if(false !== $match) { |
|
| 46 | + if (false !== $match) { |
|
| 47 | 47 | return $route->setParams($match); |
| 48 | 48 | } |
| 49 | 49 | }); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $route = $this->router->resolve($request); |
| 45 | 45 | |
| 46 | 46 | $response = $this->resolve($route->getAction(), $route->getQueryParams()); |
| 47 | - if(false === $response instanceof ResponseInterface) { |
|
| 47 | + if (false === $response instanceof ResponseInterface) { |
|
| 48 | 48 | $response = Response::create($response); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | protected function getParams() |
| 103 | 103 | { |
| 104 | - return function (ReflectionParameter $param) { |
|
| 104 | + return function(ReflectionParameter $param) { |
|
| 105 | 105 | return $param->getClass(); |
| 106 | 106 | }; |
| 107 | 107 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | header("$key: " . implode(',', $value)); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if($this->hasHeader('Content-Type') === false) { |
|
| 83 | + if ($this->hasHeader('Content-Type') === false) { |
|
| 84 | 84 | header(vsprintf( |
| 85 | 85 | 'Content-Type: %s', |
| 86 | 86 | $this->hasHeader('Content-Type') ? $this->getHeader('Content-Type') : [$this->contentType] |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | if ($this->compression) { |
| 94 | 94 | ob_start('ob_gzhandler'); |
| 95 | 95 | } |
| 96 | - echo (string)$this->getBody(); |
|
| 96 | + echo (string) $this->getBody(); |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
@@ -102,6 +102,6 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function __toString() |
| 104 | 104 | { |
| 105 | - return (string)$this->getBody(); |
|
| 105 | + return (string) $this->getBody(); |
|
| 106 | 106 | } |
| 107 | 107 | } |