public static function setRequestContext(ServerRequestInterface $request)
    {
        $uri = $request->getUri();
        static::$_requestContext = [
            '_base' => $request->getAttribute('base'),
            '_port' => $uri->getPort(),
            '_scheme' => $uri->getScheme(),
            '_host' => $uri->getHost(),
        ];
    }
public static function setRequestContext(ServerRequestInterface $request)
    {
        $uri = $request->getUri();
        static::$_requestContext = [
            '_base' => $request->getAttribute('base'),
            '_port' => $uri->getPort(),
            '_scheme' => $uri->getScheme(),
            '_host' => $uri->getHost(),
        ];
    }
public static function setRequestContext ( ServerRequestInterface $ request ) { $ uri = $ request -> getUri ( ) ; static :: $ _requestContext = [ '_base' => $ request -> getAttribute ( 'base' ) , '_port' => $ uri -> getPort ( ) , '_scheme' => $ uri -> getScheme ( ) , '_host' => $ uri -> getHost ( ) , ] ; }
Store the request context for a given request.

@param \Psr\Http\Message\ServerRequestInterface $request The request instance.
@return void
@throws \InvalidArgumentException When parameter is an incorrect type.
Store the request context for a given request .