2
2
3
3
namespace Http \Client \Exception ;
4
4
5
- use Psr \Http \Message \ResponseInterface ;
6
-
7
5
/**
8
- * @author GeLo <geloen.eric @gmail.com>
6
+ * @author Márk Sági-Kazár <mark.sagikazar @gmail.com>
9
7
*/
10
8
final class BatchException extends TransferException
11
9
{
@@ -14,16 +12,10 @@ final class BatchException extends TransferException
14
12
*/
15
13
private $ exceptions ;
16
14
17
- /**
18
- * @var ResponseInterface[]
19
- */
20
- private $ responses ;
21
-
22
15
/**
23
16
* @param TransferException[] $exceptions
24
- * @param ResponseInterface[] $responses
25
17
*/
26
- public function __construct (array $ exceptions = [], array $ responses = [] )
18
+ public function __construct (array $ exceptions = [])
27
19
{
28
20
parent ::__construct ('An error occurred when sending multiple requests. ' );
29
21
@@ -33,15 +25,7 @@ public function __construct(array $exceptions = [], array $responses = [])
33
25
}
34
26
}
35
27
36
- foreach ($ responses as $ response ) {
37
- if (!$ response instanceof ResponseInterface) {
38
- throw new InvalidArgumentException ('Response is not an instanceof Psr\Http\Message\ResponseInterface ' );
39
- }
40
- }
41
-
42
-
43
28
$ this ->exceptions = $ exceptions ;
44
- $ this ->responses = $ responses ;
45
29
}
46
30
47
31
/**
@@ -75,36 +59,4 @@ public function hasExceptions()
75
59
{
76
60
return !empty ($ this ->exceptions );
77
61
}
78
-
79
- /**
80
- * Returns all responses
81
- *
82
- * @return ResponseInterface[]
83
- */
84
- public function getResponses ()
85
- {
86
- return $ this ->responses ;
87
- }
88
-
89
- /**
90
- * Checks if a specific response exists
91
- *
92
- * @param ResponseInterface $response
93
- *
94
- * @return boolean
95
- */
96
- public function hasResponse (ResponseInterface $ response )
97
- {
98
- return array_search ($ response , $ this ->responses , true ) !== false ;
99
- }
100
-
101
- /**
102
- * Checks if any response exists
103
- *
104
- * @return boolean
105
- */
106
- public function hasResponses ()
107
- {
108
- return !empty ($ this ->responses );
109
- }
110
62
}
0 commit comments