Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MockHandler.php

function MockHandler::invokeStats

Parameters

mixed $reason Promise or reason.:

1 call to MockHandler::invokeStats()
MockHandler::__invoke in vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php

File

vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php, line 200

Class

MockHandler
Handler that returns responses or throw exceptions from a queue.

Namespace

GuzzleHttp\Handler

Code

private function invokeStats(RequestInterface $request, array $options, ?ResponseInterface $response = null, $reason = null) : void {
    if (isset($options['on_stats'])) {
        $transferTime = $options['transfer_time'] ?? 0;
        $stats = new TransferStats($request, $response, $transferTime, $reason);
        $options['on_stats']($stats);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal