| Total Complexity | 2 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Post implements \JsonSerializable |
||
| 6 | { |
||
| 7 | private $id; |
||
| 8 | private $title; |
||
| 9 | |||
| 10 | public function __construct($id, $title) |
||
| 11 | { |
||
| 12 | $this->id = $id; |
||
| 13 | $this->title = $title; |
||
| 14 | } |
||
| 15 | |||
| 16 | public function jsonSerialize() |
||
| 17 | { |
||
| 18 | return [ |
||
| 19 | 'id' => $this->id, |
||
| 20 | 'title' => $this->title, |
||
| 21 | ]; |
||
| 24 |