Documentation

Proxy
in package

Provides basic proxies for handlers.

Tags
final

Table of Contents

Methods

wrapStreaming()  : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
Sends streaming requests to a streaming compatible handler while sending all other requests to a default handler.
wrapSync()  : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
Sends synchronous requests to a specific handler while sending all other requests to another handler.
wrapTlsFallback()  : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
Sends requests to a fallback handler when the default cURL handler cannot honor TLS 1.2 selection.
requiresTls12Fallback()  : bool

Methods

wrapStreaming()

Sends streaming requests to a streaming compatible handler while sending all other requests to a default handler.

public static wrapStreaming(callable(RequestInterface, array<string|int, mixed>): PromiseInterface $default, callable(RequestInterface, array<string|int, mixed>): PromiseInterface $streaming) : callable(RequestInterface, array<string|int, mixed>): PromiseInterface

This, for example, could be useful for taking advantage of the performance benefits of curl while still supporting true streaming through the StreamHandler.

Parameters
$default : callable(RequestInterface, array<string|int, mixed>): PromiseInterface

Handler used for non-streaming responses

$streaming : callable(RequestInterface, array<string|int, mixed>): PromiseInterface

Handler used for streaming responses

Return values
callable(RequestInterface, array<string|int, mixed>): PromiseInterface —

Returns the composed handler.

wrapSync()

Sends synchronous requests to a specific handler while sending all other requests to another handler.

public static wrapSync(callable(RequestInterface, array<string|int, mixed>): PromiseInterface $default, callable(RequestInterface, array<string|int, mixed>): PromiseInterface $sync) : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
Parameters
$default : callable(RequestInterface, array<string|int, mixed>): PromiseInterface

Handler used for normal responses

$sync : callable(RequestInterface, array<string|int, mixed>): PromiseInterface

Handler used for synchronous responses.

Return values
callable(RequestInterface, array<string|int, mixed>): PromiseInterface —

Returns the composed handler.

wrapTlsFallback()

Sends requests to a fallback handler when the default cURL handler cannot honor TLS 1.2 selection.

public static wrapTlsFallback(callable(RequestInterface, array<string|int, mixed>): PromiseInterface $default, callable(RequestInterface, array<string|int, mixed>): PromiseInterface $fallback) : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
Parameters
$default : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
$fallback : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
Return values
callable(RequestInterface, array<string|int, mixed>): PromiseInterface —

Returns the composed handler.

requiresTls12Fallback()

private static requiresTls12Fallback(array<string, mixed> $options) : bool
Parameters
$options : array<string, mixed>
Return values
bool
On this page

Search results