Conditions | 4 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | function smarty_modifier_date($input) |
||
18 | { |
||
19 | if (gettype($input) === 'object' |
||
20 | && (get_class($input) === DateTime::class || get_class($input) === DateTimeImmutable::class) |
||
21 | ) { |
||
22 | /** @var $date DateTime|DateTimeImmutable */ |
||
23 | $date = $input; |
||
24 | $dateString = $date->format('Y-m-d H:i:s'); |
||
25 | |||
26 | return $dateString; |
||
27 | } |
||
28 | else { |
||
29 | return $input; |
||
30 | } |
||
31 | } |