BatchResult
in package
FinalYes
Responses and exceptions returned from parallel request execution.
Tags
Table of Contents
Properties
- $exceptions : SplObjectStorage<RequestInterface, ClientExceptionInterface>
- $responses : SplObjectStorage<RequestInterface, ResponseInterface>
Methods
- __clone() : mixed
- __construct() : mixed
- addException() : BatchResult
- Adds an exception in an immutable way.
- addResponse() : BatchResult
- Adds a response in an immutable way.
- getExceptionFor() : ClientExceptionInterface
- Returns the exception for a failed request.
- getExceptions() : array<string|int, ClientExceptionInterface>
- Returns all exceptions for the unsuccessful requests.
- getResponseFor() : ResponseInterface
- Returns the response for a successful request.
- getResponses() : array<string|int, ResponseInterface>
- Returns all successful responses.
- hasExceptions() : bool
- Checks if there are any unsuccessful requests at all.
- hasResponses() : bool
- Checks if there are any successful responses at all.
- isFailed() : bool
- Checks if there is an exception for a request, meaning the request failed.
- isSuccessful() : bool
- Checks if there is a successful response for a request.
Properties
$exceptions
private
SplObjectStorage<RequestInterface, ClientExceptionInterface>
$exceptions
$responses
private
SplObjectStorage<RequestInterface, ResponseInterface>
$responses
Methods
__clone()
public
__clone() : mixed
__construct()
public
__construct() : mixed
addException()
Adds an exception in an immutable way.
public
addException(RequestInterface $request, ClientExceptionInterface $exception) : BatchResult
Parameters
- $request : RequestInterface
- $exception : ClientExceptionInterface
Return values
BatchResult —the new BatchResult with this request-exception pair added to it
addResponse()
Adds a response in an immutable way.
public
addResponse(RequestInterface $request, ResponseInterface $response) : BatchResult
Parameters
- $request : RequestInterface
- $response : ResponseInterface
Return values
BatchResult —the new BatchResult with this request-response pair added to it
getExceptionFor()
Returns the exception for a failed request.
public
getExceptionFor(RequestInterface $request) : ClientExceptionInterface
Parameters
- $request : RequestInterface
Tags
Return values
ClientExceptionInterfacegetExceptions()
Returns all exceptions for the unsuccessful requests.
public
getExceptions() : array<string|int, ClientExceptionInterface>
Return values
array<string|int, ClientExceptionInterface>getResponseFor()
Returns the response for a successful request.
public
getResponseFor(RequestInterface $request) : ResponseInterface
Parameters
- $request : RequestInterface
Tags
Return values
ResponseInterfacegetResponses()
Returns all successful responses.
public
getResponses() : array<string|int, ResponseInterface>
Return values
array<string|int, ResponseInterface>hasExceptions()
Checks if there are any unsuccessful requests at all.
public
hasExceptions() : bool
Return values
boolhasResponses()
Checks if there are any successful responses at all.
public
hasResponses() : bool
Return values
boolisFailed()
Checks if there is an exception for a request, meaning the request failed.
public
isFailed(RequestInterface $request) : bool
Parameters
- $request : RequestInterface
Return values
boolisSuccessful()
Checks if there is a successful response for a request.
public
isSuccessful(RequestInterface $request) : bool
Parameters
- $request : RequestInterface