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\HandlerCode
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);
}
}