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

Breadcrumb

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

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\Handler

Code

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

API Navigation

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