| 1 | <?php |
||
| 7 | abstract class AbstractFormatter |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var Httpstatus |
||
| 11 | */ |
||
| 12 | private $http_status; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param Httpstatus $http_status |
||
| 16 | */ |
||
| 17 | 25 | public function __construct(Httpstatus $http_status) |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Get the content types this formatter can satisfy. |
||
| 24 | * |
||
| 25 | * @return array |
||
| 26 | */ |
||
| 27 | 1 | public static function accepts() |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Get the content type of the response body. |
||
| 38 | * |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | abstract protected function type(); |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Get the response body from the payload. |
||
| 45 | * |
||
| 46 | * @param PayloadInterface $payload |
||
| 47 | * |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | abstract protected function body(PayloadInterface $payload); |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get the response status from the payload. |
||
| 54 | * |
||
| 55 | * @param PayloadInterface $payload |
||
| 56 | * |
||
| 57 | * @return integer |
||
|
1 ignored issue
–
show
|
|||
| 58 | */ |
||
| 59 | 17 | public function status(PayloadInterface $payload) |
|
| 80 | } |
||
| 81 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.