| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function buildCell(Cell $cell, array $options) |
||
| 14 | { |
||
| 15 | $value = $cell->value; |
||
| 16 | |||
| 17 | if (null === $value) { |
||
| 18 | return; |
||
| 19 | } |
||
| 20 | |||
| 21 | if (false === is_int($value)) { |
||
| 22 | throw new \InvalidArgumentException(sprintf( |
||
| 23 | 'Money column requires an integer value, got "%s"', |
||
| 24 | gettype($value) |
||
| 25 | )); |
||
| 26 | } |
||
| 27 | |||
| 28 | $cell->template = 'Money'; |
||
| 29 | $cell->value = $cell->value / $options['divisor']; |
||
| 30 | $cell->value = number_format($cell->value, $options['scale']); |
||
| 31 | $cell->parameters['currency'] = $options['currency']; |
||
| 32 | } |
||
| 33 | |||
| 46 |