1: | <?php |
2: | namespace Worldline\Connect\Sdk\Communication; |
3: | |
4: | use Worldline\Connect\Sdk\Logging\CommunicatorLogger; |
5: | |
6: | /** |
7: | * Class Connection |
8: | * |
9: | * @package Worldline\Connect\Sdk\Communication |
10: | */ |
11: | interface Connection |
12: | { |
13: | /** |
14: | * @param string $requestUri |
15: | * @param string[] $requestHeaders |
16: | * @param callable $responseHandler Callable accepting the response status code, a response body chunk and the response headers |
17: | */ |
18: | public function get($requestUri, $requestHeaders, callable $responseHandler); |
19: | |
20: | /** |
21: | * @param string $requestUri |
22: | * @param string[] $requestHeaders |
23: | * @param callable $responseHandler Callable accepting the response status code, a response body chunk and the response headers |
24: | */ |
25: | public function delete($requestUri, $requestHeaders, callable $responseHandler); |
26: | |
27: | /** |
28: | * @param string $requestUri |
29: | * @param string[] $requestHeaders |
30: | * @param string|MultipartFormDataObject $body |
31: | * @param callable $responseHandler Callable accepting the response status code, a response body chunk and the response headers |
32: | */ |
33: | public function post($requestUri, $requestHeaders, $body, callable $responseHandler); |
34: | |
35: | /** |
36: | * @param string $requestUri |
37: | * @param string[] $requestHeaders |
38: | * @param string|MultipartFormDataObject $body |
39: | * @param callable $responseHandler Callable accepting the response status code, a response body chunk and the response headers |
40: | */ |
41: | public function put($requestUri, $requestHeaders, $body, callable $responseHandler); |
42: | |
43: | /** |
44: | * @param CommunicatorLogger $communicatorLogger |
45: | */ |
46: | public function enableLogging(CommunicatorLogger $communicatorLogger); |
47: | |
48: | /** |
49: | * |
50: | */ |
51: | public function disableLogging(); |
52: | } |
53: |