Documentation

StreamHandler
in package

HTTP handler that uses PHP's HTTP stream wrapper.

Tags
final

Table of Contents

$lastHeaders  : array<string|int, mixed>
__invoke()  : PromiseInterface
Sends an HTTP request.
add_cert()  : void
add_debug()  : void
add_progress()  : void
add_proxy()  : void
add_timeout()  : void
add_verify()  : void
addNotification()  : void
callArray()  : callable
checkDecode()  : array<string|int, mixed>
createResource()  : resource
Create a resource and check to ensure it was created successfully
createResponse()  : PromiseInterface
createSink()  : StreamInterface
createStream()  : resource
drain()  : StreamInterface
Drains the source stream into the "sink" client option.
getDefaultContext()  : array<string|int, mixed>
invokeStats()  : void
parse_proxy()  : array<string|int, mixed>
Parses the given proxy URL to make it compatible with the format PHP's stream context expects.
resolveHost()  : UriInterface

Properties

$lastHeaders

private array<string|int, mixed> $lastHeaders = []

Methods

add_cert()

private add_cert(RequestInterface $request, array<string|int, mixed> &$options, mixed $value, array<string|int, mixed> &$params) : void
Parameters
$request : RequestInterface
$options : array<string|int, mixed>
$value : mixed

as passed via Request transfer options.

$params : array<string|int, mixed>
Return values
void

add_debug()

private add_debug(RequestInterface $request, array<string|int, mixed> &$options, mixed $value, array<string|int, mixed> &$params) : void
Parameters
$request : RequestInterface
$options : array<string|int, mixed>
$value : mixed

as passed via Request transfer options.

$params : array<string|int, mixed>
Return values
void

add_progress()

private add_progress(RequestInterface $request, array<string|int, mixed> &$options, mixed $value, array<string|int, mixed> &$params) : void
Parameters
$request : RequestInterface
$options : array<string|int, mixed>
$value : mixed

as passed via Request transfer options.

$params : array<string|int, mixed>
Return values
void

add_proxy()

private add_proxy(RequestInterface $request, array<string|int, mixed> &$options, mixed $value, array<string|int, mixed> &$params) : void
Parameters
$request : RequestInterface
$options : array<string|int, mixed>
$value : mixed

as passed via Request transfer options.

$params : array<string|int, mixed>
Return values
void

add_timeout()

private add_timeout(RequestInterface $request, array<string|int, mixed> &$options, mixed $value, array<string|int, mixed> &$params) : void
Parameters
$request : RequestInterface
$options : array<string|int, mixed>
$value : mixed

as passed via Request transfer options.

$params : array<string|int, mixed>
Return values
void

add_verify()

private add_verify(RequestInterface $request, array<string|int, mixed> &$options, mixed $value, array<string|int, mixed> &$params) : void
Parameters
$request : RequestInterface
$options : array<string|int, mixed>
$value : mixed

as passed via Request transfer options.

$params : array<string|int, mixed>
Return values
void

addNotification()

private static addNotification(array<string|int, mixed> &$params, callable $notify) : void
Parameters
$params : array<string|int, mixed>
$notify : callable
Return values
void

callArray()

private static callArray(array<string|int, mixed> $functions) : callable
Parameters
$functions : array<string|int, mixed>
Return values
callable

checkDecode()

private checkDecode(array<string|int, mixed> $options, array<string|int, mixed> $headers, resource $stream) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>
$headers : array<string|int, mixed>
$stream : resource
Return values
array<string|int, mixed>

createResource()

Create a resource and check to ensure it was created successfully

private createResource(callable $callback) : resource
Parameters
$callback : callable

Callable that returns stream resource

Tags
throws
RuntimeException

on error

Return values
resource

parse_proxy()

Parses the given proxy URL to make it compatible with the format PHP's stream context expects.

private parse_proxy(string $url) : array<string|int, mixed>
Parameters
$url : string
Return values
array<string|int, mixed>

Search results