RequestBuilder
in package
RequestBuilder applies global state or other resources to a ServerRequest
Builder uses a fluent interface returning itself. To return the produced request, run ->build()
Table of Contents
Properties
- $request : ServerRequestInterface
- $requestFactory : ServerRequestFactoryInterface
- $streamFactory : StreamFactoryInterface
- $uriFactory : UriFactoryInterface
Methods
- __construct() : mixed
- build() : ServerRequestInterface
- withGlobalVariables() : self
- Create a new server request populated with global state
- withHeaders() : self
- Add headers from list
Properties
$request
private
ServerRequestInterface
$request
$requestFactory
private
ServerRequestFactoryInterface
$requestFactory
$streamFactory
private
StreamFactoryInterface
$streamFactory
$uriFactory
private
UriFactoryInterface
$uriFactory
Methods
__construct()
public
__construct(ServerRequestFactoryInterface $requestFactory, StreamFactoryInterface $streamFactory, UriFactoryInterface $uriFactory) : mixed
Parameters
- $requestFactory : ServerRequestFactoryInterface
- $streamFactory : StreamFactoryInterface
- $uriFactory : UriFactoryInterface
build()
public
build() : ServerRequestInterface
Return values
ServerRequestInterfacewithGlobalVariables()
Create a new server request populated with global state
public
withGlobalVariables() : self
Return values
selfwithHeaders()
Add headers from list
public
withHeaders(array<string|int, mixed> $headers) : self
Parameters
- $headers : array<string|int, mixed>