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