Handler that returns responses or throw exceptions from a queue.

CloneableInstantiable
ImplementsCountable
Methods
public __construct(?array $queue = NULL, ?callable $onFulfilled = NULL, ?callable $onRejected = NULL)
 
The passed in value must be an array of {@see Psr7\Http\Message\ResponseInterface} objects, Exceptions, callables, or Promises.

    public __invoke(Psr\Http\Message\RequestInterface $request, array $options)
    public append()
     
    Adds one or more variadic requests, exceptions, callables, or promises to the queue.

    public count()
     
    Returns the number of remaining items in the queue.

    • return int
    public static createWithMiddleware(?array $queue = NULL, ?callable $onFulfilled = NULL, ?callable $onRejected = NULL)
     
    Creates a new MockHandler that uses the default handler stack list of middlewares.

    • return HandlerStack
    public getLastOptions()
     
    Get the last received request options.

    • return array
    public getLastRequest()
     
    Get the last received request.

    • return RequestInterface
    public reset()
    Properties
    private $lastOptions
    private $lastRequest
    private $onFulfilled
    private $onRejected
    private $queue
    Methods
    private invokeStats(Psr\Http\Message\RequestInterface $request, array $options, ?Psr\Http\Message\ResponseInterface $response = NULL, $reason = NULL)
    Methods
    public static createWithMiddleware(?array $queue = NULL, ?callable $onFulfilled = NULL, ?callable $onRejected = NULL)
     
    Creates a new MockHandler that uses the default handler stack list of middlewares.

    • return HandlerStack
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only