Total Complexity | 8 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
5 | class Money |
||
6 | { |
||
7 | private int $amount; |
||
8 | private Currency $currency; |
||
9 | |||
10 | 8 | private function __construct(int $amount, Currency $currency) |
|
11 | { |
||
12 | 8 | $this->amount = $amount; |
|
13 | 8 | $this->currency = $currency; |
|
14 | 8 | } |
|
15 | |||
16 | 8 | public static function create(int $amount, Currency $currency): Money |
|
19 | } |
||
20 | |||
21 | 3 | public function amount(): int |
|
24 | } |
||
25 | |||
26 | 3 | public function amountFloat(): float |
|
29 | } |
||
30 | |||
31 | 3 | public function currency(): Currency |
|
34 | } |
||
35 | |||
36 | 3 | public function formatted(string $thousandsSeparator = ',', string $decimalsSeparator = '.'): string |
|
44 | ); |
||
45 | } |
||
46 | |||
47 | 3 | public function equal(Money $money): bool |
|
53 |