public function createFromArray(
        array $server,
        array $headers = [],
        array $cookie  = [],
        array $get     = [],
        array $post    = [],
        array $files   = [],
        $body          = null
    ): ServerRequestInterface {
        if (isset($server['SERVER_ADDR'])) {
            $server['SERVER_ADDR'] = \str_replace('Server IP: ', '', $server['SERVER_ADDR']);
        }

        $serverRequest = new ServerRequest(
            Uri::createFromServer($server),
            $this->getMethodFromServer($server),
            $headers,
            $body,
            $this->marshalProtocolVersion($server),
            $server
        );

        return $serverRequest
            ->withCookieParams($cookie)
            ->withQueryParams($get)
            ->withParsedBody($post)
            ->withUploadedFiles(Util::normalizeFiles($files));
    }
public function createFromArray(
        array $server,
        array $headers = [],
        array $cookie  = [],
        array $get     = [],
        array $post    = [],
        array $files   = [],
        $body          = null
    ): ServerRequestInterface {
        if (isset($server['SERVER_ADDR'])) {
            $server['SERVER_ADDR'] = \str_replace('Server IP: ', '', $server['SERVER_ADDR']);
        }

        $serverRequest = new ServerRequest(
            Uri::createFromServer($server),
            $this->getMethodFromServer($server),
            $headers,
            $body,
            $this->marshalProtocolVersion($server),
            $server
        );

        return $serverRequest
            ->withCookieParams($cookie)
            ->withQueryParams($get)
            ->withParsedBody($post)
            ->withUploadedFiles(Util::normalizeFiles($files));
    }
public function createFromArray ( array $ server , array $ headers = [ ] , array $ cookie = [ ] , array $ get = [ ] , array $ post = [ ] , array $ files = [ ] , $ body = null ) : ServerRequestInterface { if ( isset ( $ server [ 'SERVER_ADDR' ] ) ) { $ server [ 'SERVER_ADDR' ] = \ str_replace ( 'Server IP: ' , '' , $ server [ 'SERVER_ADDR' ] ) ; } $ serverRequest = new ServerRequest ( Uri :: createFromServer ( $ server ) , $ this -> getMethodFromServer ( $ server ) , $ headers , $ body , $ this -> marshalProtocolVersion ( $ server ) , $ server ) ; return $ serverRequest -> withCookieParams ( $ cookie ) -> withQueryParams ( $ get ) -> withParsedBody ( $ post ) -> withUploadedFiles ( Util :: normalizeFiles ( $ files ) ) ; }
Create a new server request from a set of arrays.

@param array                                                         $server  typically $_SERVER or similar structure
@param array                                                         $headers typically the output of getallheaders() or similar structure
@param array                                                         $cookie  typically $_COOKIE or similar structure
@param array                                                         $get     typically $_GET or similar structure
@param array                                                         $post    typically $_POST or similar structure
@param array                                                         $files   typically $_FILES or similar structure
@param null|\Psr\Http\Message\ServerRequestInterface|resource|string $body    Typically stdIn

@throws \InvalidArgumentException if no valid method or URI can be determined

@return \Psr\Http\Message\ServerRequestInterface
Create a new server request from a set of arrays .