Documentation

TransferStats
in package

FinalYes

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

Table of Contents

Properties

$handlerErrorData  : mixed|null
$handlerStats  : array<string|int, mixed>
$request  : RequestInterface
$response  : ResponseInterface|null
$transferTime  : float|null

Methods

__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

$handlerStats

private array<string|int, mixed> $handlerStats

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.

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.

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

        
On this page

Search results