| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function create(SimpleXMLElement $xmlAmount, ?SimpleXMLElement $CdtDbtInd): Money |
||
| 23 | { |
||
| 24 | $amount = (string) $xmlAmount; |
||
| 25 | |||
| 26 | if ((string) $CdtDbtInd === 'DBIT') { |
||
| 27 | $amount = (string) ((float) $amount * -1); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** @psalm-var non-empty-string $currency */ |
||
| 31 | $currency = (string) $xmlAmount['Ccy']; |
||
| 32 | |||
| 33 | return $this->decimalMoneyParser->parse( |
||
| 34 | $amount, |
||
| 35 | new Currency($currency) |
||
| 36 | ); |
||
| 39 |