Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function process(?string $answer): void |
||
18 | { |
||
19 | $amount = $this->readAttr('amount', $this->store->get('amount')); |
||
20 | |||
21 | if (!$amount) { |
||
22 | return; |
||
23 | } |
||
24 | |||
25 | $money = number_format( |
||
26 | (float) $amount, |
||
27 | (int) $this->readAttr('decimals', $this->store->get('decimals', 0)), |
||
28 | $this->readAttr('decimal_separator', $this->store->get('decimal_separator', '.')), |
||
29 | $this->readAttr('thousands_separator', $this->store->get('thousands_separator', ',')) |
||
30 | ); |
||
31 | |||
32 | $currency = $this->readAttr('currency', $this->store->get('currency')); |
||
33 | |||
34 | $this->store->put('_amount', "{$currency} {$money}"); |
||
35 | } |
||
37 |