You are here

public function MockHandler::__construct in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php \GuzzleHttp\Handler\MockHandler::__construct()

The passed in value must be an array of {callables, or Promises.

Parameters

array $queue:

callable $onFulfilled Callback to invoke when the return value is fulfilled.:

callable $onRejected Callback to invoke when the return value is rejected.:

See also

Psr7\Http\Message\ResponseInterface} objects, Exceptions,

File

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

Class

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

Namespace

GuzzleHttp\Handler

Code

public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null) {
  $this->onFulfilled = $onFulfilled;
  $this->onRejected = $onRejected;
  if ($queue) {
    call_user_func_array([
      $this,
      'append',
    ], $queue);
  }
}