Documentation

TransferStats
in package

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

Table of Contents

$handlerErrorData  : mixed
$handlerStats  : mixed
$request  : mixed
$response  : mixed
$transferTime  : mixed
__construct()  : mixed
getEffectiveUri()  : UriInterface
Get the effective URI the request was sent to.
getHandlerErrorData()  : mixed
Gets handler specific error data.
getHandlerStat()  : mixed|null
Get a specific handler statistic from the handler by name.
getHandlerStats()  : array<string|int, mixed>
Gets an array of all of the handler specific transfer data.
getRequest()  : RequestInterface
getResponse()  : ResponseInterface|null
Returns the response that was received (if any).
getTransferTime()  : float|null
Get the estimated time the request was being transferred by the handler.
hasResponse()  : bool
Returns true if a response was received.

Properties

Methods

__construct()

public __construct(RequestInterface $request[, ResponseInterface|null $response = null ][, float|null $transferTime = null ][, mixed $handlerErrorData = null ][, array<string|int, mixed> $handlerStats = [] ]) : mixed
Parameters
$request : RequestInterface

Request that was sent.

$response : ResponseInterface|null = null

Response received (if any)

$transferTime : float|null = null

Total handler transfer time.

$handlerErrorData : mixed = null

Handler error data.

$handlerStats : array<string|int, mixed> = []

Handler specific stats.

Return values
mixed

getHandlerErrorData()

Gets handler specific error data.

public getHandlerErrorData() : mixed

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.

Return values
mixed

getHandlerStat()

Get a specific handler statistic from the handler by name.

public getHandlerStat(string $stat) : mixed|null
Parameters
$stat : string

Handler specific transfer stat to retrieve.

Return values
mixed|null

getHandlerStats()

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

public getHandlerStats() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTransferTime()

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

public getTransferTime() : float|null
Return values
float|null

Time in seconds.

hasResponse()

Returns true if a response was received.

public hasResponse() : bool
Return values
bool

Search results