TransferStats
in package
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
$handlerErrorData
private
mixed|null
$handlerErrorData
$handlerStats
private
array<string|int, mixed>
$handlerStats
$request
private
RequestInterface
$request
$response
private
ResponseInterface|null
$response
$transferTime
private
float|null
$transferTime
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.
getEffectiveUri()
Get the effective URI the request was sent to.
public
getEffectiveUri() : UriInterface
Return values
UriInterfacegetHandlerErrorData()
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|nullgetHandlerStats()
Gets an array of all of the handler specific transfer data.
public
getHandlerStats() : array<string|int, mixed>
Return values
array<string|int, mixed>getRequest()
public
getRequest() : RequestInterface
Return values
RequestInterfacegetResponse()
Returns the response that was received (if any).
public
getResponse() : ResponseInterface|null
Return values
ResponseInterface|nullgetTransferTime()
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