| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function drawCards(int $numberOfCards): array |
||
| 17 | { |
||
| 18 | $drawnCards = []; |
||
| 19 | for ($i = 0; $i < $numberOfCards; $i++) { |
||
| 20 | if (empty($this->cards)) { |
||
| 21 | throw new Exception('No cards left in the deck'); |
||
| 22 | } |
||
| 23 | $drawnCards[] = array_pop($this->cards); |
||
| 24 | } |
||
| 25 | return $drawnCards; |
||
| 26 | } |
||
| 48 |