| Total Complexity | 7 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Card |
||
| 9 | { |
||
| 10 | /** @var string The suit of the card */ |
||
| 11 | protected $suit; |
||
| 12 | |||
| 13 | /** @var string The value of the card */ |
||
| 14 | protected $value; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Card constructor. |
||
| 18 | * |
||
| 19 | * @param string $suit The suit of the card |
||
| 20 | * @param string $value The value of the card |
||
| 21 | */ |
||
| 22 | 13 | public function __construct($suit, $value) |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Get the suit of the card. |
||
| 30 | * |
||
| 31 | * @return string |
||
| 32 | */ |
||
| 33 | 2 | public function getSuit(): string |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get the value of the card. |
||
| 40 | * |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | 2 | public function getValue(): string |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Get a string representation of the card. |
||
| 50 | * |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 1 | public function getAsString(): string |
|
| 54 | { |
||
| 55 | 1 | return "{$this->value} of {$this->suit}"; |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Get the Blackjack value of the card. |
||
| 60 | * |
||
| 61 | * @return int |
||
| 62 | */ |
||
| 63 | 1 | public function getBlackjackValue(): int |
|
| 74 | } |
||
| 75 | } |
||
| 76 |