Total Complexity | 2 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class CardHand |
||
11 | { |
||
12 | /** |
||
13 | * @var Card[] array of Card objects representing the hand |
||
14 | */ |
||
15 | private array $cards = []; |
||
16 | |||
17 | /** |
||
18 | * Adds a card to the hand. |
||
19 | * |
||
20 | * @param Card $card the card to add |
||
21 | */ |
||
22 | 16 | public function addCard(Card $card): void |
|
23 | { |
||
24 | 16 | $this->cards[] = $card; |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * Returns all cards in the hand. |
||
29 | * |
||
30 | * @return Card[] an array of Card objects |
||
31 | */ |
||
32 | 18 | public function getCards(): array |
|
35 | } |
||
36 | } |
||
37 |