1313 */
1414interface BatchResult
1515{
16+ /**
17+ * Checks if there are any successful responses at all.
18+ *
19+ * @return boolean
20+ */
21+ public function hasResponses ();
22+
1623 /**
1724 * Returns all successful responses.
1825 *
@@ -21,31 +28,24 @@ interface BatchResult
2128 public function getResponses ();
2229
2330 /**
24- * Returns the response for a successful request.
31+ * Checks if there is a successful response for a request.
2532 *
2633 * @param RequestInterface $request
2734 *
28- * @return ResponseInterface
29- *
30- * @throws \UnexpectedValueException If request was not part of the batch or failed.
31- */
32- public function getResponseFor (RequestInterface $ request );
33-
34- /**
35- * Checks if there are any successful responses at all
36- *
3735 * @return boolean
3836 */
39- public function hasResponses ( );
37+ public function isSuccessful ( RequestInterface $ request );
4038
4139 /**
42- * Checks if there is a successful response for a request.
40+ * Returns the response for a successful request.
4341 *
4442 * @param RequestInterface $request
4543 *
4644 * @return ResponseInterface
45+ *
46+ * @throws \UnexpectedValueException If request was not part of the batch or failed.
4747 */
48- public function hasResponseFor (RequestInterface $ request );
48+ public function getResponseFor (RequestInterface $ request );
4949
5050 /**
5151 * Adds a response in an immutable way.
@@ -58,22 +58,11 @@ public function hasResponseFor(RequestInterface $request);
5858 public function addResponse (RequestInterface $ request , ResponseInterface $ response );
5959
6060 /**
61- * Checks if a request was successful.
62- *
63- * @param RequestInterface $request
64- *
65- * @return boolean
66- */
67- public function isSuccessful (RequestInterface $ request );
68-
69- /**
70- * Checks if a request has failed.
71- *
72- * @param RequestInterface $request
61+ * Checks if there are any unsuccessful requests at all.
7362 *
7463 * @return boolean
7564 */
76- public function isFailed ( RequestInterface $ request );
65+ public function hasExceptions ( );
7766
7867 /**
7968 * Returns all exceptions for the unsuccessful requests.
@@ -83,24 +72,24 @@ public function isFailed(RequestInterface $request);
8372 public function getExceptions ();
8473
8574 /**
86- * Returns the exception for a failed request.
75+ * Checks if there is an exception for a request, meaning the request failed .
8776 *
8877 * @param RequestInterface $request
8978 *
90- * @return Exception
91- *
92- * @throws \UnexpectedValueException If request was not part of the batch or was successful.
79+ * @return boolean
9380 */
94- public function getExceptionFor (RequestInterface $ request );
81+ public function isFailed (RequestInterface $ request );
9582
9683 /**
97- * Checks if there is an exception for a request.
84+ * Returns the exception for a failed request.
9885 *
9986 * @param RequestInterface $request
10087 *
101- * @return boolean
88+ * @return Exception
89+ *
90+ * @throws \UnexpectedValueException If request was not part of the batch or was successful.
10291 */
103- public function hasExceptionFor (RequestInterface $ request );
92+ public function getExceptionFor (RequestInterface $ request );
10493
10594 /**
10695 * Adds an exception in an immutable way.
0 commit comments