We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 4 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 19 | public function drawCard() : Card { |
||
| 20 | if (count($this->drawnCardIDs) === self::MAX_CARDS) { |
||
| 21 | throw new \Exception('No cards left to draw from this deck!'); |
||
| 22 | } |
||
| 23 | while ($cardID = rand(0, self::MAX_CARDS - 1)) { |
||
| 24 | if (!in_array($cardID, $this->drawnCardIDs)) { |
||
| 25 | break; |
||
| 26 | } |
||
| 27 | } |
||
| 28 | $this->drawnCardIDs[] = $cardID; |
||
| 29 | return new Card($cardID); |
||
| 30 | } |
||
| 33 |