Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

(no description)

File Size: 133 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

TransferStats:: (9 methods):
  __construct()
  getRequest()
  getResponse()
  hasResponse()
  getHandlerErrorData()
  getEffectiveUri()
  getTransferTime()
  getHandlerStats()
  getHandlerStat()


Class: TransferStats  - X-Ref

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

__construct(RequestInterface $request,?ResponseInterface $response = null,?float $transferTime = null,$handlerErrorData = null,array $handlerStats = [])   X-Ref

param: RequestInterface       $request          Request that was sent.
param: ResponseInterface|null $response         Response received (if any)
param: float|null             $transferTime     Total handler transfer time.
param: mixed                  $handlerErrorData Handler error data.
param: array                  $handlerStats     Handler specific stats.

getRequest()   X-Ref
No description

getResponse()   X-Ref
Returns the response that was received (if any).


hasResponse()   X-Ref
Returns true if a response was received.


getHandlerErrorData()   X-Ref
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.

return: mixed

getEffectiveUri()   X-Ref
Get the effective URI the request was sent to.


getTransferTime()   X-Ref
Get the estimated time the request was being transferred by the handler.

return: float|null Time in seconds.

getHandlerStats()   X-Ref
Gets an array of all of the handler specific transfer data.


getHandlerStat(string $stat)   X-Ref
Get a specific handler statistic from the handler by name.

param: string $stat Handler specific transfer stat to retrieve.
return: mixed|null