14
14
interface BatchResult
15
15
{
16
16
/**
17
- * Returns all successful responses
17
+ * Returns all successful responses.
18
18
*
19
19
* @return ResponseInterface[]
20
20
*/
21
21
public function getResponses ();
22
22
23
23
/**
24
- * Returns a response of a request
24
+ * Returns the response for a successful request.
25
25
*
26
26
* @param RequestInterface $request
27
27
*
28
28
* @return ResponseInterface
29
29
*
30
- * @throws \UnexpectedValueException If request is not found
30
+ * @throws \UnexpectedValueException If request was not part of the batch or failed.
31
31
*/
32
32
public function getResponseFor (RequestInterface $ request );
33
33
@@ -39,7 +39,7 @@ public function getResponseFor(RequestInterface $request);
39
39
public function hasResponses ();
40
40
41
41
/**
42
- * Checks if there is a response of a request
42
+ * Checks if there is a successful response for a request.
43
43
*
44
44
* @param RequestInterface $request
45
45
*
@@ -48,17 +48,17 @@ public function hasResponses();
48
48
public function hasResponseFor (RequestInterface $ request );
49
49
50
50
/**
51
- * Adds a response in an immutable way
51
+ * Adds a response in an immutable way.
52
52
*
53
53
* @param RequestInterface $request
54
54
* @param ResponseInterface $response
55
55
*
56
- * @return BatchResult
56
+ * @return BatchResult the new BatchResult with this request-response pair added to it.
57
57
*/
58
58
public function addResponse (RequestInterface $ request , ResponseInterface $ response );
59
59
60
60
/**
61
- * Checks if a request is successful
61
+ * Checks if a request was successful.
62
62
*
63
63
* @param RequestInterface $request
64
64
*
@@ -67,7 +67,7 @@ public function addResponse(RequestInterface $request, ResponseInterface $respon
67
67
public function isSuccessful (RequestInterface $ request );
68
68
69
69
/**
70
- * Checks if a request is failed
70
+ * Checks if a request has failed.
71
71
*
72
72
* @param RequestInterface $request
73
73
*
@@ -76,25 +76,25 @@ public function isSuccessful(RequestInterface $request);
76
76
public function isFailed (RequestInterface $ request );
77
77
78
78
/**
79
- * Returns all exceptions
79
+ * Returns all exceptions for the unsuccessful requests.
80
80
*
81
81
* @return Exception[]
82
82
*/
83
83
public function getExceptions ();
84
84
85
85
/**
86
- * Returns an exception for a request
86
+ * Returns the exception for a failed request.
87
87
*
88
88
* @param RequestInterface $request
89
89
*
90
90
* @return Exception
91
91
*
92
- * @throws \UnexpectedValueException If request is not found
92
+ * @throws \UnexpectedValueException If request was not part of the batch or was successful.
93
93
*/
94
94
public function getExceptionFor (RequestInterface $ request );
95
95
96
96
/**
97
- * Checks if there is an exception for a request
97
+ * Checks if there is an exception for a request.
98
98
*
99
99
* @param RequestInterface $request
100
100
*
@@ -103,12 +103,12 @@ public function getExceptionFor(RequestInterface $request);
103
103
public function hasExceptionFor (RequestInterface $ request );
104
104
105
105
/**
106
- * Adds an exception
106
+ * Adds an exception in an immutable way.
107
107
*
108
108
* @param RequestInterface $request
109
109
* @param Exception $exception
110
110
*
111
- * @return BatchResult
111
+ * @return BatchResult the new BatchResult with this request-exception pair added to it.
112
112
*/
113
113
public function addException (RequestInterface $ request , Exception $ exception );
114
114
}
0 commit comments