Conditions | 4 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
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 === $value instanceof \DateTime) { |
||
22 | throw new \InvalidArgumentException(sprintf( |
||
23 | 'The DateTime column requires a \DateTime value at "%s", but got "%s"', |
||
24 | $options['property'], is_object($value) ? get_class($value) : gettype($value) |
||
25 | )); |
||
26 | } |
||
27 | |||
28 | $cell->template = 'DateTime'; |
||
29 | $cell->parameters['format'] = $options['format']; |
||
30 | } |
||
31 | |||
42 |