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