Serializer
5 years ago
Curl.php
5 years ago
Encoder.php
4 years ago
Environment.php
5 years ago
HttpClient.php
4 years ago
HttpException.php
4 years ago
HttpRequest.php
5 years ago
HttpResponse.php
4 years ago
IOException.php
5 years ago
Injector.php
4 years ago
Serializer.php
5 years ago
Serializer.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace PayPalHttp; |
| 4 | |
| 5 | /** |
| 6 | * Interface Serializer |
| 7 | * @package PayPalHttp |
| 8 | * |
| 9 | * Used to implement different serializers for different content types |
| 10 | */ |
| 11 | interface Serializer |
| 12 | { |
| 13 | /** |
| 14 | * @return string Regex that matches the content type it supports. |
| 15 | */ |
| 16 | public function contentType(); |
| 17 | |
| 18 | /** |
| 19 | * @param HttpRequest $request |
| 20 | * @return string representation of your data after being serialized. |
| 21 | */ |
| 22 | public function encode(HttpRequest $request); |
| 23 | |
| 24 | /** |
| 25 | * @param $body |
| 26 | * @return mixed object/string representing the de-serialized response body. |
| 27 | */ |
| 28 | public function decode($body); |
| 29 | } |
| 30 |