| Total Complexity | 6 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | trait ReceiveTrait |
||
| 11 | { |
||
| 12 | /** @var int $points */ |
||
| 13 | private int $points = 0; |
||
| 14 | |||
| 15 | /** @var Card[] $cards */ |
||
| 16 | private array $cards = []; |
||
| 17 | |||
| 18 | /** @return int As total points */ |
||
| 19 | 8 | public function getPoints(): int |
|
| 20 | { |
||
| 21 | 8 | return $this->points; |
|
| 22 | } |
||
| 23 | |||
| 24 | /** @return Card[] As total cards */ |
||
| 25 | 6 | public function getCards(): array |
|
| 26 | { |
||
| 27 | 6 | return $this->cards; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Receive a dealt card and add points. |
||
| 32 | * |
||
| 33 | * @param Card $card |
||
| 34 | */ |
||
| 35 | 23 | public function receive(Card $card): void |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Set propertiess to their initial values. |
||
| 50 | */ |
||
| 51 | 1 | public function reset(): void |
|
| 57 |