public function MockHandler::append in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php \GuzzleHttp\Handler\MockHandler::append()
Adds one or more variadic requests, exceptions, callables, or promises to the queue.
File
- vendor/
guzzlehttp/ guzzle/ src/ Handler/ MockHandler.php, line 106
Class
- MockHandler
- Handler that returns responses or throw exceptions from a queue.
Namespace
GuzzleHttp\HandlerCode
public function append() {
foreach (func_get_args() as $value) {
if ($value instanceof ResponseInterface || $value instanceof \Exception || $value instanceof PromiseInterface || is_callable($value)) {
$this->queue[] = $value;
}
else {
throw new \InvalidArgumentException('Expected a response or ' . 'exception. Found ' . \GuzzleHttp\describe_type($value));
}
}
}