class HttpClientCache (View source)

Stores an HTTP Client in order to prevent multiple instantiations.

Methods

static void
setHttpClient(ClientInterface $client = null)

Cache an HTTP Client for later calls.

static ClientInterface|null
getHttpClient()

Get the stored HTTP Client, or null.

Details

static void setHttpClient(ClientInterface $client = null)

Cache an HTTP Client for later calls.

Passing null will unset the cached client.

Parameters

ClientInterface $client

Return Value

void

static ClientInterface|null getHttpClient()

Get the stored HTTP Client, or null.

Return Value

ClientInterface|null