Skip to content

Commit

Permalink
Fix possibility extends
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyar committed Mar 5, 2018
1 parent e4edc79 commit fef0761
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ private static function normalizeNestedFileSpec(array $files = [])
* $_FILES
* $_SERVER
*
* @return ServerRequestInterface
* @return $this|ServerRequestInterface
*/
public static function fromGlobals()
{
$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
$headers = function_exists('getallheaders') ? getallheaders() : [];
$uri = self::getUriFromGlobals();
$uri = static::getUriFromGlobals();
$body = new LazyOpenStream('php://input', 'r+');
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1';

$serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER);
$serverRequest = new static($method, $uri, $headers, $body, $protocol, $_SERVER);

return $serverRequest
->withCookieParams($_COOKIE)
Expand Down

0 comments on commit fef0761

Please sign in to comment.