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

Breadcrumb

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

function MockHandler::append

Adds one or more variadic requests, exceptions, callables, or promises to the queue.

Parameters

mixed ...$values:

1 call to MockHandler::append()
MockHandler::__construct in vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php
The passed in value must be an array of {callables, or Promises.

File

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

Class

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

Namespace

GuzzleHttp\Handler

Code

public function append(...$values) : void {
    foreach ($values as $value) {
        if ($value instanceof ResponseInterface || $value instanceof \Throwable || $value instanceof PromiseInterface || \is_callable($value)) {
            $this->queue[] = $value;
        }
        else {
            throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value));
        }
    }
}

API Navigation

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