Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function formatCell($value, array $row, $context) |
||
21 | { |
||
22 | if (empty($value)) { |
||
23 | return ''; |
||
24 | } |
||
25 | $inputFormat = $this->getOptions()['input_format']; |
||
26 | if ($inputFormat == 'object') { |
||
27 | $dateTime = $value; |
||
28 | } else { |
||
29 | $dateTime = \DateTime::createFromFormat($inputFormat, $value); |
||
30 | } |
||
31 | |||
32 | return $dateTime->format($this->getOptions()['output_format']); |
||
33 | } |
||
34 | } |
||
35 |