\GuzzleHttpTransferStats

Represents data at the point after it was transferred either successfully or after a network error.

Summary

Methods
Properties
Constants
__construct()
getRequest()
getResponse()
hasResponse()
getHandlerErrorData()
getEffectiveUri()
getTransferTime()
getHandlerStats()
getHandlerStat()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$request
$response
$transferTime
$handlerStats
$handlerErrorData
N/A

Properties

$request

$request : \Psr\Http\Message\RequestInterface

Type

RequestInterface

$transferTime

$transferTime : float|null

Type

float|null

$handlerStats

$handlerStats : array

Type

array

$handlerErrorData

$handlerErrorData : mixed|null

Type

mixed|null

Methods

__construct()

__construct(\Psr\Http\Message\RequestInterface  $request, \Psr\Http\Message\ResponseInterface|null  $response = null, float|null  $transferTime = null, mixed  $handlerErrorData = null, array  $handlerStats = []) : mixed

Parameters

\Psr\Http\Message\RequestInterface $request

Request that was sent.

\Psr\Http\Message\ResponseInterface|null $response

Response received (if any)

float|null $transferTime

Total handler transfer time.

mixed $handlerErrorData

Handler error data.

array $handlerStats

Handler specific stats.

Returns

mixed —

getRequest()

getRequest() : \Psr\Http\Message\RequestInterface

Returns

\Psr\Http\Message\RequestInterface —

getResponse()

getResponse() : ?\Psr\Http\Message\ResponseInterface

Returns the response that was received (if any).

Returns

?\Psr\Http\Message\ResponseInterface —

hasResponse()

hasResponse() : bool

Returns true if a response was received.

Returns

bool —

getHandlerErrorData()

getHandlerErrorData() : mixed

Gets handler specific error data.

This might be an exception, a integer representing an error code, or anything else. Relying on this value assumes that you know what handler you are using.

Returns

mixed —

getEffectiveUri()

getEffectiveUri() : \Psr\Http\Message\UriInterface

Get the effective URI the request was sent to.

Returns

\Psr\Http\Message\UriInterface —

getTransferTime()

getTransferTime() : float|null

Get the estimated time the request was being transferred by the handler.

Returns

float|null —

Time in seconds.

getHandlerStats()

getHandlerStats() : array

Gets an array of all of the handler specific transfer data.

Returns

array —

getHandlerStat()

getHandlerStat(string  $stat) : mixed|null

Get a specific handler statistic from the handler by name.

Parameters

string $stat

Handler specific transfer stat to retrieve.

Returns

mixed|null —