Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function buildCell(Cell $cell, array $options) |
||
13 | { |
||
14 | $value = $cell->value; |
||
15 | |||
16 | if (null === $value) { |
||
17 | return; |
||
18 | } |
||
19 | |||
20 | if (false === $value instanceof \DateTime) { |
||
21 | throw new \InvalidArgumentException(sprintf( |
||
22 | 'The DateTime column requires a \DateTime value at "%s", but got "%s"', |
||
23 | $options['property'], is_object($value) ? get_class($value) : gettype($value) |
||
24 | )); |
||
25 | } |
||
26 | |||
27 | $cell->parameters['format'] = $options['format']; |
||
28 | } |
||
29 | |||
40 |