1 | <?php |
||
20 | class HttpAdapterException extends \Exception |
||
21 | { |
||
22 | /** |
||
23 | * @var InternalRequestInterface|null |
||
24 | */ |
||
25 | private $request; |
||
26 | |||
27 | /** |
||
28 | * @var ResponseInterface|null |
||
29 | */ |
||
30 | private $response; |
||
31 | |||
32 | /** |
||
33 | * @return bool |
||
34 | */ |
||
35 | 228 | public function hasRequest() |
|
39 | |||
40 | /** |
||
41 | * @return InternalRequestInterface|null |
||
42 | */ |
||
43 | 246 | public function getRequest() |
|
47 | |||
48 | /** |
||
49 | * @param InternalRequestInterface|null $request |
||
50 | */ |
||
51 | 255 | public function setRequest(InternalRequestInterface $request = null) |
|
55 | |||
56 | /** |
||
57 | * @return bool |
||
58 | */ |
||
59 | 27 | public function hasResponse() |
|
63 | |||
64 | /** |
||
65 | * @return ResponseInterface|null |
||
66 | */ |
||
67 | 18 | public function getResponse() |
|
71 | |||
72 | /** |
||
73 | * @param ResponseInterface|null $response |
||
74 | */ |
||
75 | 182 | public function setResponse(ResponseInterface $response = null) |
|
79 | |||
80 | /** |
||
81 | * @param string $uri |
||
82 | * @param string $adapter |
||
83 | * @param string $error |
||
84 | * |
||
85 | * @return HttpAdapterException |
||
86 | */ |
||
87 | 759 | public static function cannotFetchUri($uri, $adapter, $error) |
|
96 | |||
97 | /** |
||
98 | * @param string $error |
||
99 | * |
||
100 | * @return HttpAdapterException |
||
101 | */ |
||
102 | 9 | public static function cannotLoadCookieJar($error) |
|
106 | |||
107 | /** |
||
108 | * @param string $error |
||
109 | * |
||
110 | * @return HttpAdapterException |
||
111 | */ |
||
112 | 9 | public static function cannotSaveCookieJar($error) |
|
116 | |||
117 | /** |
||
118 | * @param string $name |
||
119 | * |
||
120 | * @return HttpAdapterException |
||
121 | */ |
||
122 | 9 | public static function httpAdapterDoesNotExist($name) |
|
126 | |||
127 | /** |
||
128 | * @param string $name |
||
129 | * |
||
130 | * @return HttpAdapterException |
||
131 | */ |
||
132 | 9 | public static function httpAdapterIsNotUsable($name) |
|
136 | |||
137 | /** |
||
138 | * @return HttpAdapterException |
||
139 | */ |
||
140 | 9 | public static function httpAdaptersAreNotUsable() |
|
144 | |||
145 | /** |
||
146 | * @param string $class |
||
147 | * |
||
148 | * @return HttpAdapterException |
||
149 | */ |
||
150 | 9 | public static function httpAdapterMustImplementInterface($class) |
|
154 | |||
155 | /** |
||
156 | * @param string $adapter |
||
157 | * @param string $subAdapter |
||
158 | * |
||
159 | * @return HttpAdapterException |
||
160 | */ |
||
161 | 9 | public static function doesNotSupportSubAdapter($adapter, $subAdapter) |
|
165 | |||
166 | /** |
||
167 | * @param string $extension |
||
168 | * @param string $adapter |
||
169 | * |
||
170 | * @return HttpAdapterException |
||
171 | */ |
||
172 | 4 | public static function extensionIsNotLoaded($extension, $adapter) |
|
176 | |||
177 | /** |
||
178 | * @param string $uri |
||
179 | * @param int $maxRedirects |
||
180 | * @param string $adapter |
||
181 | * |
||
182 | * @return HttpAdapterException |
||
183 | */ |
||
184 | 27 | public static function maxRedirectsExceeded($uri, $maxRedirects, $adapter) |
|
188 | |||
189 | /** |
||
190 | * @param mixed $request |
||
191 | * |
||
192 | * @return HttpAdapterException |
||
193 | */ |
||
194 | 9 | public static function requestIsNotValid($request) |
|
201 | |||
202 | /** |
||
203 | * @param mixed $stream |
||
204 | * @param string $wrapper |
||
205 | * @param string $expected |
||
206 | * |
||
207 | * @return HttpAdapterException |
||
208 | */ |
||
209 | public static function streamIsNotValid($stream, $wrapper, $expected) |
||
218 | |||
219 | /** |
||
220 | * @param string $uri |
||
221 | * @param float $timeout |
||
222 | * @param string $adapter |
||
223 | * |
||
224 | * @return HttpAdapterException |
||
225 | */ |
||
226 | 18 | public static function timeoutExceeded($uri, $timeout, $adapter) |
|
230 | } |
||
231 |