public static function fromGlobals(array $server = null, array $query = null, array $body = null, array $cookies = null, array $files = null) : ServerRequestInterface
	{
		$server  = $server  ?? $_SERVER ?? [];
		$query   = $query   ?? $_GET    ?? [];
		$body    = $body    ?? $_POST   ?? [];
		$cookies = $cookies ?? $_COOKIE ?? [];
		$files   = $files   ?? $_FILES  ?? [];

		$request = (new ServerRequest)
		->withProtocolVersion(request_http_version($server))
		->withBody(request_body())
		->withMethod(request_method($server))
		->withUri(request_uri($server))
		->withServerParams($server)
		->withCookieParams($cookies)
		->withQueryParams($query)
		->withUploadedFiles(request_files($files))
		->withParsedBody($body);

		foreach (request_headers($server) as $name => $value)
		{
			$request = $request->withHeader($name, $value);
		}

		return $request;
	}
public static function fromGlobals(array $server = null, array $query = null, array $body = null, array $cookies = null, array $files = null) : ServerRequestInterface
	{
		$server  = $server  ?? $_SERVER ?? [];
		$query   = $query   ?? $_GET    ?? [];
		$body    = $body    ?? $_POST   ?? [];
		$cookies = $cookies ?? $_COOKIE ?? [];
		$files   = $files   ?? $_FILES  ?? [];

		$request = (new ServerRequest)
		->withProtocolVersion(request_http_version($server))
		->withBody(request_body())
		->withMethod(request_method($server))
		->withUri(request_uri($server))
		->withServerParams($server)
		->withCookieParams($cookies)
		->withQueryParams($query)
		->withUploadedFiles(request_files($files))
		->withParsedBody($body);

		foreach (request_headers($server) as $name => $value)
		{
			$request = $request->withHeader($name, $value);
		}

		return $request;
	}
public static function fromGlobals ( array $ server = null , array $ query = null , array $ body = null , array $ cookies = null , array $ files = null ) : ServerRequestInterface { $ server = $ server ?? $ _SERVER ?? [ ] ; $ query = $ query ?? $ _GET ?? [ ] ; $ body = $ body ?? $ _POST ?? [ ] ; $ cookies = $ cookies ?? $ _COOKIE ?? [ ] ; $ files = $ files ?? $ _FILES ?? [ ] ; $ request = ( new ServerRequest ) -> withProtocolVersion ( request_http_version ( $ server ) ) -> withBody ( request_body ( ) ) -> withMethod ( request_method ( $ server ) ) -> withUri ( request_uri ( $ server ) ) -> withServerParams ( $ server ) -> withCookieParams ( $ cookies ) -> withQueryParams ( $ query ) -> withUploadedFiles ( request_files ( $ files ) ) -> withParsedBody ( $ body ) ; foreach ( request_headers ( $ server ) as $ name => $ value ) { $ request = $ request -> withHeader ( $ name , $ value ) ; } return $ request ; }
Creates the server request instance from superglobals variables

@param null|array $server
@param null|array $query
@param null|array $body
@param null|array $cookies
@param null|array $files

@return ServerRequestInterface

@link http://php.net/manual/en/language.variables.superglobals.php
@link https://www.php-fig.org/psr/psr-15/meta/
Creates the server request instance from superglobals variables