PHP Класс GuzzleHttp\Handler\MockHandler

Наследование: implements Countable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.
__invoke ( Psr\Http\Message\RequestInterface $request, array $options )
append ( ) Adds one or more variadic requests, exceptions, callables, or promises to the queue.
count ( ) : integer Returns the number of remaining items in the queue.
createWithMiddleware ( array $queue = null, callable $onFulfilled = null, callable $onRejected = null ) : GuzzleHttp\HandlerStack Creates a new MockHandler that uses the default handler stack list of middlewares.
getLastOptions ( ) : array Get the last received request options.
getLastRequest ( ) : Psr\Http\Message\RequestInterface Get the last received request.

Приватные методы

Метод Описание
invokeStats ( Psr\Http\Message\RequestInterface $request, array $options, Psr\Http\Message\ResponseInterface $response = null, $reason = null )

Описание методов

__construct() публичный Метод

The passed in value must be an array of {@see Psr7\Http\Message\ResponseInterface} objects, Exceptions, callables, or Promises.
public __construct ( array $queue = null, callable $onFulfilled = null, callable $onRejected = null )
$queue array
$onFulfilled callable Callback to invoke when the return value is fulfilled.
$onRejected callable Callback to invoke when the return value is rejected.

__invoke() публичный Метод

public __invoke ( Psr\Http\Message\RequestInterface $request, array $options )
$request Psr\Http\Message\RequestInterface
$options array

append() публичный Метод

Adds one or more variadic requests, exceptions, callables, or promises to the queue.
public append ( )

count() публичный Метод

Returns the number of remaining items in the queue.
public count ( ) : integer
Результат integer

createWithMiddleware() публичный статический Метод

Creates a new MockHandler that uses the default handler stack list of middlewares.
public static createWithMiddleware ( array $queue = null, callable $onFulfilled = null, callable $onRejected = null ) : GuzzleHttp\HandlerStack
$queue array Array of responses, callables, or exceptions.
$onFulfilled callable Callback to invoke when the return value is fulfilled.
$onRejected callable Callback to invoke when the return value is rejected.
Результат GuzzleHttp\HandlerStack

getLastOptions() публичный Метод

Get the last received request options.
public getLastOptions ( ) : array
Результат array

getLastRequest() публичный Метод

Get the last received request.
public getLastRequest ( ) : Psr\Http\Message\RequestInterface
Результат Psr\Http\Message\RequestInterface