| 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: | * @return void |
| 19: | */ |
| 20: | public function get(string $requestUri, array $requestHeaders, callable $responseHandler): void; |
| 21: | |
| 22: | /** |
| 23: | * @param string $requestUri |
| 24: | * @param string[] $requestHeaders |
| 25: | * @param callable $responseHandler Callable accepting the response status code, a response body chunk and the response headers |
| 26: | * |
| 27: | * @return void |
| 28: | */ |
| 29: | public function delete(string $requestUri, array $requestHeaders, callable $responseHandler): void; |
| 30: | |
| 31: | /** |
| 32: | * @param string $requestUri |
| 33: | * @param string[] $requestHeaders |
| 34: | * @param string|MultipartFormDataObject $body |
| 35: | * @param callable $responseHandler Callable accepting the response status code, |
| 36: | * a response body chunk and the response headers |
| 37: | * |
| 38: | * @return void |
| 39: | */ |
| 40: | public function post(string $requestUri, array $requestHeaders, $body, callable $responseHandler): void; |
| 41: | |
| 42: | /** |
| 43: | * @param string $requestUri |
| 44: | * @param string[] $requestHeaders |
| 45: | * @param string|MultipartFormDataObject $body |
| 46: | * @param callable $responseHandler Callable accepting the response status code, |
| 47: | * a response body chunk and the response headers |
| 48: | * |
| 49: | * @return void |
| 50: | */ |
| 51: | public function put(string $requestUri, array $requestHeaders, $body, callable $responseHandler): void; |
| 52: | |
| 53: | /** |
| 54: | * @param CommunicatorLogger $communicatorLogger |
| 55: | * |
| 56: | * @return void |
| 57: | */ |
| 58: | public function enableLogging(CommunicatorLogger $communicatorLogger): void; |
| 59: | |
| 60: | /** |
| 61: | * @return void |
| 62: | */ |
| 63: | public function disableLogging(): void; |
| 64: | } |
| 65: |