Total Complexity | 11 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class CardHand |
||
9 | { |
||
10 | /** @var Card[] */ |
||
11 | private array $cards = []; |
||
12 | |||
13 | 6 | public function addCard(Card $card): void |
|
14 | { |
||
15 | 6 | $this->cards[] = $card; |
|
16 | } |
||
17 | |||
18 | /** |
||
19 | * @return Card[] |
||
20 | */ |
||
21 | 2 | public function getCards(): array |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * Get total points of the hand. |
||
28 | * Handle the Aces. |
||
29 | * @return int |
||
30 | */ |
||
31 | 5 | public function getTotal(): int |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * Convert the hand to an array. |
||
60 | * |
||
61 | * @return array<int, array<string, string>> |
||
62 | */ |
||
63 | 1 | public function toArray(): array |
|
72 |