HttpFactory
in package
implements
RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface
FinalYes
Implements all of the PSR-17 interfaces.
Note: in consuming code it is recommended to require the implemented interfaces and inject the instance of this class multiple times.
Table of Contents
Interfaces
- RequestFactoryInterface
- ResponseFactoryInterface
- ServerRequestFactoryInterface
- StreamFactoryInterface
- UploadedFileFactoryInterface
- UriFactoryInterface
Methods
- createRequest() : RequestInterface
- createResponse() : ResponseInterface
- createServerRequest() : ServerRequestInterface
- createStream() : StreamInterface
- createStreamFromFile() : StreamInterface
- createStreamFromResource() : StreamInterface
- createUploadedFile() : UploadedFileInterface
- createUri() : UriInterface
Methods
createRequest()
public
createRequest(string $method, mixed $uri) : RequestInterface
Parameters
- $method : string
- $uri : mixed
Return values
RequestInterfacecreateResponse()
public
createResponse([int $code = 200 ][, string $reasonPhrase = '' ]) : ResponseInterface
Parameters
- $code : int = 200
- $reasonPhrase : string = ''
Return values
ResponseInterfacecreateServerRequest()
public
createServerRequest(string $method, mixed $uri[, array<string|int, mixed> $serverParams = [] ]) : ServerRequestInterface
Parameters
- $method : string
- $uri : mixed
- $serverParams : array<string|int, mixed> = []
Return values
ServerRequestInterfacecreateStream()
public
createStream([string $content = '' ]) : StreamInterface
Parameters
- $content : string = ''
Return values
StreamInterfacecreateStreamFromFile()
public
createStreamFromFile(string $file[, string $mode = 'r' ]) : StreamInterface
Parameters
- $file : string
- $mode : string = 'r'
Return values
StreamInterfacecreateStreamFromResource()
public
createStreamFromResource(mixed $resource) : StreamInterface
Parameters
- $resource : mixed
Return values
StreamInterfacecreateUploadedFile()
public
createUploadedFile(StreamInterface $stream[, int|null $size = null ][, int $error = UPLOAD_ERR_OK ][, string|null $clientFilename = null ][, string|null $clientMediaType = null ]) : UploadedFileInterface
Parameters
- $stream : StreamInterface
- $size : int|null = null
- $error : int = UPLOAD_ERR_OK
- $clientFilename : string|null = null
- $clientMediaType : string|null = null
Return values
UploadedFileInterfacecreateUri()
public
createUri([string $uri = '' ]) : UriInterface
Parameters
- $uri : string = ''