Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
44 | public function parseValue($value) |
||
45 | { |
||
46 | if (!is_string($value)) { // quite naive, but after all this is example |
||
47 | throw new \UnexpectedValueException('Cannot represent value as Chronos date: ' . Utils::printSafe($value)); |
||
48 | } |
||
49 | |||
50 | if ($value === '') { |
||
51 | return null; |
||
52 | } |
||
53 | |||
54 | $date = new Chronos($value); |
||
55 | $date = $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
||
56 | |||
57 | return $date; |
||
58 | } |
||
78 |