13
13
*/
14
14
interface BatchResult
15
15
{
16
+ /**
17
+ * Checks if there are any successful responses at all.
18
+ *
19
+ * @return boolean
20
+ */
21
+ public function hasResponses ();
22
+
16
23
/**
17
24
* Returns all successful responses.
18
25
*
@@ -21,31 +28,24 @@ interface BatchResult
21
28
public function getResponses ();
22
29
23
30
/**
24
- * Returns the response for a successful request.
31
+ * Checks if there is a successful response for a request.
25
32
*
26
33
* @param RequestInterface $request
27
34
*
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
- *
37
35
* @return boolean
38
36
*/
39
- public function hasResponses ( );
37
+ public function isSuccessful ( RequestInterface $ request );
40
38
41
39
/**
42
- * Checks if there is a successful response for a request.
40
+ * Returns the response for a successful request.
43
41
*
44
42
* @param RequestInterface $request
45
43
*
46
44
* @return ResponseInterface
45
+ *
46
+ * @throws \UnexpectedValueException If request was not part of the batch or failed.
47
47
*/
48
- public function hasResponseFor (RequestInterface $ request );
48
+ public function getResponseFor (RequestInterface $ request );
49
49
50
50
/**
51
51
* Adds a response in an immutable way.
@@ -58,22 +58,11 @@ public function hasResponseFor(RequestInterface $request);
58
58
public function addResponse (RequestInterface $ request , ResponseInterface $ response );
59
59
60
60
/**
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.
73
62
*
74
63
* @return boolean
75
64
*/
76
- public function isFailed ( RequestInterface $ request );
65
+ public function hasExceptions ( );
77
66
78
67
/**
79
68
* Returns all exceptions for the unsuccessful requests.
@@ -83,24 +72,24 @@ public function isFailed(RequestInterface $request);
83
72
public function getExceptions ();
84
73
85
74
/**
86
- * Returns the exception for a failed request.
75
+ * Checks if there is an exception for a request, meaning the request failed .
87
76
*
88
77
* @param RequestInterface $request
89
78
*
90
- * @return Exception
91
- *
92
- * @throws \UnexpectedValueException If request was not part of the batch or was successful.
79
+ * @return boolean
93
80
*/
94
- public function getExceptionFor (RequestInterface $ request );
81
+ public function isFailed (RequestInterface $ request );
95
82
96
83
/**
97
- * Checks if there is an exception for a request.
84
+ * Returns the exception for a failed request.
98
85
*
99
86
* @param RequestInterface $request
100
87
*
101
- * @return boolean
88
+ * @return Exception
89
+ *
90
+ * @throws \UnexpectedValueException If request was not part of the batch or was successful.
102
91
*/
103
- public function hasExceptionFor (RequestInterface $ request );
92
+ public function getExceptionFor (RequestInterface $ request );
104
93
105
94
/**
106
95
* Adds an exception in an immutable way.
0 commit comments