function MockHandler::__construct
The passed in value must be an array of {callables, or Promises.
Parameters
array<int, mixed>|null $queue The parameters to be passed to the append function, as an indexed array.:
callable|null $onFulfilled Callback to invoke when the return value is fulfilled.:
callable|null $onRejected Callback to invoke when the return value is rejected.:
See also
ResponseInterface} objects, Exceptions,
File
-
vendor/
guzzlehttp/ guzzle/ src/ Handler/ MockHandler.php, line 69
Class
- MockHandler
- Handler that returns responses or throw exceptions from a queue.
Namespace
GuzzleHttp\HandlerCode
public function __construct(?array $queue = null, ?callable $onFulfilled = null, ?callable $onRejected = null) {
$this->onFulfilled = $onFulfilled;
$this->onRejected = $onRejected;
if ($queue) {
// array_values included for BC
$this->append(...array_values($queue));
}
}