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