Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
GuzzleHttp\Handler\MockHandler Class Reference
Inheritance diagram for GuzzleHttp\Handler\MockHandler:

Public Member Functions

 __construct (array $queue=null, callable $onFulfilled=null, callable $onRejected=null)
 The passed in value must be an array of {.
 
 __invoke (RequestInterface $request, array $options)
 
 append (... $values)
 Adds one or more variadic requests, exceptions, callables, or promises to the queue.
 
 count ()
 Returns the number of remaining items in the queue.
 
 getLastOptions ()
 Get the last received request options.
 
 getLastRequest ()
 Get the last received request.
 
 reset ()
 

Static Public Member Functions

static createWithMiddleware (array $queue=null, callable $onFulfilled=null, callable $onRejected=null)
 Creates a new MockHandler that uses the default handler stack list of middlewares.
 

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\Handler\MockHandler::__construct ( array $queue = null,
callable $onFulfilled = null,
callable $onRejected = null )

The passed in value must be an array of {.

See also
Psr\Http\Message\ResponseInterface} objects, Exceptions, callables, or Promises.
Parameters
array<int,mixed>|null$queue The parameters to be passed to the append function, as an indexed array.
callable | null$onFulfilledCallback to invoke when the return value is fulfilled.
callable | null$onRejectedCallback to invoke when the return value is rejected.

Member Function Documentation

◆ append()

GuzzleHttp\Handler\MockHandler::append ( ...)

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

Parameters
mixed...$values

◆ createWithMiddleware()

static GuzzleHttp\Handler\MockHandler::createWithMiddleware ( array $queue = null,
callable $onFulfilled = null,
callable $onRejected = null )
static

Creates a new MockHandler that uses the default handler stack list of middlewares.

Parameters
array | null$queueArray of responses, callables, or exceptions.
callable | null$onFulfilledCallback to invoke when the return value is fulfilled.
callable | null$onRejectedCallback to invoke when the return value is rejected.

The documentation for this class was generated from the following file: