SDK for PHP 3.x

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

createResponse()

public createResponse([int $code = 200 ][, string $reasonPhrase = '' ]) : ResponseInterface
Parameters
$code : int = 200
$reasonPhrase : string = ''
Return values
ResponseInterface

createServerRequest()

public createServerRequest(string $method, mixed $uri[, array<string|int, mixed> $serverParams = [] ]) : ServerRequestInterface
Parameters
$method : string
$uri : mixed
$serverParams : array<string|int, mixed> = []
Return values
ServerRequestInterface

createStreamFromFile()

public createStreamFromFile(string $file[, string $mode = 'r' ]) : StreamInterface
Parameters
$file : string
$mode : string = 'r'
Return values
StreamInterface

createStreamFromResource()

public createStreamFromResource(mixed $resource) : StreamInterface
Parameters
$resource : mixed
Return values
StreamInterface

createUploadedFile()

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
UploadedFileInterface

createUri()

public createUri([string $uri = '' ]) : UriInterface
Parameters
$uri : string = ''
Return values
UriInterface
On this page