| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2.0078 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 2 | public static function transform( Money $money ) { |
|
| 31 | 2 | $alphabetic_code = $money->get_currency()->get_alphabetic_code(); |
|
| 32 | |||
| 33 | 2 | if ( null === $alphabetic_code ) { |
|
| 34 | throw new \InvalidArgumentException( 'Alphabetic currency code is required to transform money to Mollie amount object.' ); |
||
| 35 | } |
||
| 36 | |||
| 37 | 2 | $amount = new Amount( |
|
| 38 | 2 | \strval( $alphabetic_code ), |
|
| 39 | 2 | $money->format() |
|
| 40 | ); |
||
| 41 | |||
| 42 | 2 | return $amount; |
|
| 43 | } |
||
| 45 |