| 1 | <?php |
||
| 6 | abstract class AbstractFormatter |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * Get the content types this formatter can satisfy. |
||
| 10 | * |
||
| 11 | * @return array |
||
| 12 | */ |
||
| 13 | 1 | public static function accepts() |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Get the content type of the response body. |
||
| 24 | * |
||
| 25 | * @return string |
||
| 26 | */ |
||
| 27 | abstract protected function type(); |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Get the response body from the payload. |
||
| 31 | * |
||
| 32 | * @param PayloadInterface $payload |
||
| 33 | * |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | abstract protected function body(PayloadInterface $payload); |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get the response status from the payload. |
||
| 40 | * |
||
| 41 | * @param PayloadInterface $payload |
||
| 42 | * |
||
| 43 | * @return integer |
||
| 44 | */ |
||
| 45 | 6 | public function status(PayloadInterface $payload) |
|
| 63 | } |
||
| 64 |