| Total Complexity | 5 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class Post implements JsonSerializable |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | private int $id; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private string $title; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var DateTimeInterface |
||
| 24 | */ |
||
| 25 | private DateTimeInterface $date; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param int $id |
||
| 29 | * @param string $title |
||
| 30 | * @param DateTimeInterface $date |
||
| 31 | */ |
||
| 32 | 11 | public function __construct(int $id, string $title, DateTimeInterface $date) |
|
| 33 | { |
||
| 34 | 11 | $this->id = $id; |
|
| 35 | 11 | $this->title = $title; |
|
| 36 | 11 | $this->date = $date; |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return int |
||
| 41 | */ |
||
| 42 | 3 | public function getId(): int |
|
| 43 | { |
||
| 44 | 3 | return $this->id; |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | 3 | public function getTitle(): string |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return DateTimeInterface |
||
| 57 | */ |
||
| 58 | 3 | public function getDate(): DateTimeInterface |
|
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * {@inheritDoc} |
||
| 65 | */ |
||
| 66 | 7 | public function jsonSerialize(): array |
|
| 75 |