Documentation

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
RequestInterface

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<int|string, mixed> $serverParams = [] ]) : ServerRequestInterface
Parameters
$method : string
$uri : mixed
$serverParams : array<int|string, mixed> = []
Return values
ServerRequestInterface

createStream()

public createStream([string $content = '' ]) : StreamInterface
Parameters
$content : string = ''
Return values
StreamInterface

createStreamFromFile()

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

createStreamFromResource()

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

createStreamFromSource()

Creates a StreamInterface from the given source

public static createStreamFromSource([mixed $source = null ]) : StreamInterface
Parameters
$source : mixed = null
Return values
StreamInterface

createStreamFromString()

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
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

Search results