| 1 | <?php |
||
| 15 | class Currency |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * The 3-letter ISO code used to establish the currency |
||
| 19 | * this object will represent. |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $code; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Constructor |
||
| 26 | * |
||
| 27 | * Establish the currency by setting the currency code. This defines |
||
| 28 | * the currency this object represents. |
||
| 29 | * |
||
| 30 | * @param string $code |
||
| 31 | * |
||
| 32 | * @throws \MoneyMan\Exception\InvalidCurrencyCodeException |
||
| 33 | */ |
||
| 34 | 37 | public function __construct($code) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * Get the currency code. |
||
| 45 | * |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | 32 | public function getCode() |
|
| 52 | |||
| 53 | /** |
||
| 54 | * Compares if another Currency is equal to this Currency. |
||
| 55 | * |
||
| 56 | * @param Currency $currency |
||
| 57 | * |
||
| 58 | * @return bool |
||
| 59 | */ |
||
| 60 | 23 | public function equals(Currency $currency) |
|
| 64 | } |
||
| 65 |