public static function createFromGlobals(
        array $query = null,
        array $post = null,
        array $cookies = null,
        array $server = null,
        array $files = null,
        array $env = null,
        string $rawBody = null
    ) : Request {
        $query = $query ?? $_GET;
        $post = $post ?? $_POST;
        $cookies = $cookies ?? $_COOKIE;
        $server = $server ?? $_SERVER;
        $files = $files ?? $_FILES;
        $env = $env ?? $_ENV;

        // Handle the a bug that does not set CONTENT_TYPE or CONTENT_LENGTH headers
        if (array_key_exists('HTTP_CONTENT_LENGTH', $server)) {
            $server['CONTENT_LENGTH'] = $server['HTTP_CONTENT_LENGTH'];
        }

        if (array_key_exists('HTTP_CONTENT_TYPE', $server)) {
            $server['CONTENT_TYPE'] = $server['HTTP_CONTENT_TYPE'];
        }

        return new static($query, $post, $cookies, $server, $files, $env, $rawBody);
    }
public static function createFromGlobals(
        array $query = null,
        array $post = null,
        array $cookies = null,
        array $server = null,
        array $files = null,
        array $env = null,
        string $rawBody = null
    ) : Request {
        $query = $query ?? $_GET;
        $post = $post ?? $_POST;
        $cookies = $cookies ?? $_COOKIE;
        $server = $server ?? $_SERVER;
        $files = $files ?? $_FILES;
        $env = $env ?? $_ENV;

        // Handle the a bug that does not set CONTENT_TYPE or CONTENT_LENGTH headers
        if (array_key_exists('HTTP_CONTENT_LENGTH', $server)) {
            $server['CONTENT_LENGTH'] = $server['HTTP_CONTENT_LENGTH'];
        }

        if (array_key_exists('HTTP_CONTENT_TYPE', $server)) {
            $server['CONTENT_TYPE'] = $server['HTTP_CONTENT_TYPE'];
        }

        return new static($query, $post, $cookies, $server, $files, $env, $rawBody);
    }
public static function createFromGlobals ( array $ query = null , array $ post = null , array $ cookies = null , array $ server = null , array $ files = null , array $ env = null , string $ rawBody = null ) : Request { $ query = $ query ?? $ _GET ; $ post = $ post ?? $ _POST ; $ cookies = $ cookies ?? $ _COOKIE ; $ server = $ server ?? $ _SERVER ; $ files = $ files ?? $ _FILES ; $ env = $ env ?? $ _ENV ; // Handle the a bug that does not set CONTENT_TYPE or CONTENT_LENGTH headers if ( array_key_exists ( 'HTTP_CONTENT_LENGTH' , $ server ) ) { $ server [ 'CONTENT_LENGTH' ] = $ server [ 'HTTP_CONTENT_LENGTH' ] ; } if ( array_key_exists ( 'HTTP_CONTENT_TYPE' , $ server ) ) { $ server [ 'CONTENT_TYPE' ] = $ server [ 'HTTP_CONTENT_TYPE' ] ; } return new static ( $ query , $ post , $ cookies , $ server , $ files , $ env , $ rawBody ) ; }
Creates an instance of this class using the PHP globals

@param array|null $query The GET parameters, or null if using the globals
@param array|null $post The POST parameters, or null if using the globals
@param array|null $cookies The COOKIE parameters, or null if using the globals
@param array|null $server The SERVER parameters, or null if using the globals
@param array|null $files The FILES parameters, or null if using the globals
@param array|null $env The ENV parameters, or null if using the globals
@param string|null $rawBody The raw body
@return Request An instance of this class
Creates an instance of this class using the PHP globals