| 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 |
|