| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function __construct($amount, $currency = 'EUR') |
||
| 22 | { |
||
| 23 | if (!is_string($amount) && !preg_match(self::AMOUNT_FORMAT, $amount)) { |
||
| 24 | throw new \InvalidArgumentException(sprintf( |
||
| 25 | 'Malformed amount: "%s".', |
||
| 26 | $amount |
||
| 27 | )); |
||
| 28 | } |
||
| 29 | $this->amount = $amount; |
||
| 30 | $this->currency = $currency; |
||
| 31 | } |
||
| 32 | |||
| 71 |