HTTPFactory
in package
implements
RequestFactoryInterface, ResponseFactoryInterface, RequestMethodInterface, ServerRequestFactoryInterface, StatusCodeInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface
Implements the PSR-17 HTTP factories
Table of Contents
Interfaces
- RequestFactoryInterface
- ResponseFactoryInterface
- RequestMethodInterface
- ServerRequestFactoryInterface
- StatusCodeInterface
- StreamFactoryInterface
- UploadedFileFactoryInterface
- UriFactoryInterface
Methods
- createRequest() : RequestInterface
- createResponse() : ResponseInterface
- createServerRequest() : ServerRequestInterface
- createStream() : StreamInterface
- createStreamFromFile() : StreamInterface
- createStreamFromResource() : StreamInterface
- createStreamFromSource() : StreamInterface
- Creates a StreamInterface from the given source
- createStreamFromString() : StreamInterface
- Create a new writable stream from a string.
- 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<int|string, mixed> $serverParams = [] ]) : ServerRequestInterface
Parameters
- $method : string
- $uri : mixed
- $serverParams : array<int|string, mixed> = []
Return values
ServerRequestInterfacecreateStream()
public
createStream([string $content = '' ]) : StreamInterface
Parameters
- $content : string = ''
Return values
StreamInterfacecreateStreamFromFile()
public
createStreamFromFile(string $filename[, string $mode = 'r' ]) : StreamInterface
Parameters
- $filename : string
- $mode : string = 'r'
Return values
StreamInterfacecreateStreamFromResource()
public
createStreamFromResource(mixed $resource) : StreamInterface
Parameters
- $resource : mixed
Return values
StreamInterfacecreateStreamFromSource()
Creates a StreamInterface from the given source
public
static createStreamFromSource([mixed $source = null ]) : StreamInterface
Parameters
- $source : mixed = null
Return values
StreamInterfacecreateStreamFromString()
Create a new writable stream from a string.
public
static createStreamFromString([string $content = '' ][, string $mode = 'r+' ][, bool $rewind = true ]) : StreamInterface
Parameters
- $content : string = ''
- $mode : string = 'r+'
- $rewind : bool = true
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 = ''