| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | final class DefaultChangelog extends BaseModel implements Changelog |
||
| 14 | { |
||
| 15 | 5 | public function __construct( |
|
| 16 | private readonly string $version, |
||
| 17 | private readonly DateTimeInterface $date, |
||
| 18 | private readonly ChangelogStatusCollection $changes, |
||
| 19 | ) { |
||
| 20 | 5 | } |
|
| 21 | |||
| 22 | 4 | public function getVersion(): string |
|
| 23 | { |
||
| 24 | 4 | return $this->version; |
|
| 25 | } |
||
| 26 | |||
| 27 | 1 | public function getDate(): DateTimeInterface |
|
| 28 | { |
||
| 29 | 1 | return $this->date; |
|
| 30 | } |
||
| 31 | |||
| 32 | 1 | public function getChanges(): ChangelogStatusCollection |
|
| 35 | } |
||
| 36 | |||
| 37 | /** @inheritDoc */ |
||
| 38 | 2 | public function __toArray(): array |
|
| 47 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: