Guzzle 7.4.2

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

__invoke()

Sends an HTTP request.

public __invoke(RequestInterface $request, array<string|int, mixed> $options) : PromiseInterface
Parameters
$request : RequestInterface

Request to send.

$options : array<string|int, mixed>

Request transfer options.

Return values
PromiseInterface

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

createResponse()

private createResponse(RequestInterface $request, array<string|int, mixed> $options, resource $stream, float|null $startTime) : PromiseInterface
Parameters
$request : RequestInterface
$options : array<string|int, mixed>
$stream : resource
$startTime : float|null
Return values
PromiseInterface

createSink()

private createSink(StreamInterface $stream, array<string|int, mixed> $options) : StreamInterface
Parameters
$stream : StreamInterface
$options : array<string|int, mixed>
Return values
StreamInterface

createStream()

private createStream(RequestInterface $request, array<string|int, mixed> $options) : resource
Parameters
$request : RequestInterface
$options : array<string|int, mixed>
Return values
resource

drain()

Drains the source stream into the "sink" client option.

private drain(StreamInterface $source, StreamInterface $sink, string $contentLength) : StreamInterface
Parameters
$source : StreamInterface
$sink : StreamInterface
$contentLength : string

Header specifying the amount of data to read.

Tags
throws
RuntimeException

when the sink option is invalid.

Return values
StreamInterface

getDefaultContext()

private getDefaultContext(RequestInterface $request) : array<string|int, mixed>
Parameters
$request : RequestInterface
Return values
array<string|int, mixed>

invokeStats()

private invokeStats(array<string|int, mixed> $options, RequestInterface $request, float|null $startTime[, ResponseInterface $response = null ][, Throwable $error = null ]) : void
Parameters
$options : array<string|int, mixed>
$request : RequestInterface
$startTime : float|null
$response : ResponseInterface = null
$error : Throwable = null
Return values
void

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>

resolveHost()

private resolveHost(RequestInterface $request, array<string|int, mixed> $options) : UriInterface
Parameters
$request : RequestInterface
$options : array<string|int, mixed>
Return values
UriInterface

Search results