Documentation

Request
in package
implements RequestInterface uses RequestDecoratorTrait

Table of Contents

Interfaces

RequestInterface

Methods

__construct()  : mixed
getMethod()  : string
{@inheritdoc}
getRequest()  : RequestInterface
Returns the decorated request.
getRequestTarget()  : string
{@inheritdoc}
getUri()  : UriInterface
{@inheritdoc}
withMethod()  : self
{@inheritdoc}
withRequest()  : self
Exchanges the underlying request with another.
withRequestTarget()  : self
{@inheritdoc}
withUri()  : self
{@inheritdoc}

Methods

__construct()

public __construct(string $method, string|UriInterface $uri[, array<string|int, mixed> $headers = [] ][, string|null|resource|StreamInterface $body = null ][, string $version = '1.1' ]) : mixed
Parameters
$method : string

HTTP method

$uri : string|UriInterface

URI

$headers : array<string|int, mixed> = []

Request headers

$body : string|null|resource|StreamInterface = null

Request body

$version : string = '1.1'

Protocol version

getRequest()

Returns the decorated request.

public getRequest() : RequestInterface

Since the underlying Request is immutable as well exposing it is not an issue, because it's state cannot be altered

Return values
RequestInterface

withMethod()

{@inheritdoc}

public withMethod(mixed $method) : self
Parameters
$method : mixed
Return values
self

withRequest()

Exchanges the underlying request with another.

public withRequest(RequestInterface $request) : self
Parameters
$request : RequestInterface
Return values
self

withRequestTarget()

{@inheritdoc}

public withRequestTarget(mixed $requestTarget) : self
Parameters
$requestTarget : mixed
Return values
self

withUri()

{@inheritdoc}

public withUri(UriInterface $uri[, mixed $preserveHost = false ]) : self
Parameters
$uri : UriInterface
$preserveHost : mixed = false
Return values
self

        
On this page

Search results