Open Monograph Press  3.3.0
GuzzleHttp\TransferStats Class Reference

Public Member Functions

 __construct (RequestInterface $request, ResponseInterface $response=null, $transferTime=null, $handlerErrorData=null, $handlerStats=[])
 
 getEffectiveUri ()
 
 getHandlerErrorData ()
 
 getHandlerStat ($stat)
 
 getHandlerStats ()
 
 getRequest ()
 
 getResponse ()
 
 getTransferTime ()
 
 hasResponse ()
 

Detailed Description

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

Definition at line 12 of file TransferStats.php.

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\TransferStats::__construct ( RequestInterface  $request,
ResponseInterface  $response = null,
  $transferTime = null,
  $handlerErrorData = null,
  $handlerStats = [] 
)
Parameters
RequestInterface$requestRequest that was sent.
ResponseInterface | null$responseResponse received (if any)
float | null$transferTimeTotal handler transfer time.
mixed$handlerErrorDataHandler error data.
array$handlerStatsHandler specific stats.

Definition at line 27 of file TransferStats.php.

Member Function Documentation

◆ getEffectiveUri()

GuzzleHttp\TransferStats::getEffectiveUri ( )

Get the effective URI the request was sent to.

Returns
UriInterface

Definition at line 88 of file TransferStats.php.

◆ getHandlerErrorData()

GuzzleHttp\TransferStats::getHandlerErrorData ( )

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

Definition at line 78 of file TransferStats.php.

◆ getHandlerStat()

GuzzleHttp\TransferStats::getHandlerStat (   $stat)

Get a specific handler statistic from the handler by name.

Parameters
string$statHandler specific transfer stat to retrieve.
Returns
mixed|null

Definition at line 120 of file TransferStats.php.

◆ getHandlerStats()

GuzzleHttp\TransferStats::getHandlerStats ( )

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

Returns
array

Definition at line 108 of file TransferStats.php.

◆ getRequest()

GuzzleHttp\TransferStats::getRequest ( )
Returns
RequestInterface

Definition at line 44 of file TransferStats.php.

◆ getResponse()

GuzzleHttp\TransferStats::getResponse ( )

Returns the response that was received (if any).

Returns
ResponseInterface|null

Definition at line 54 of file TransferStats.php.

◆ getTransferTime()

GuzzleHttp\TransferStats::getTransferTime ( )

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

Returns
float|null Time in seconds.

Definition at line 98 of file TransferStats.php.

◆ hasResponse()

GuzzleHttp\TransferStats::hasResponse ( )

Returns true if a response was received.

Returns
bool

Definition at line 64 of file TransferStats.php.


The documentation for this class was generated from the following file: