1 | <?php |
||
5 | class DatetimeGuesser extends AbstractGuesser implements GuesserInterface |
||
6 | { |
||
7 | public function supports(array $mapping) |
||
13 | |||
14 | public function transform($str, array $mapping = null) |
||
15 | { |
||
16 | try { |
||
17 | return new \DateTime($str); |
||
18 | } catch (\Exception $e) { |
||
19 | throw new \Exception(sprintf('"%s" is not a supported date/time/datetime format. To know which formats are supported, please visit http://www.php.net/manual/en/datetime.formats.php', $str)); |
||
|
|||
20 | } |
||
21 | } |
||
22 | |||
23 | public function fake(array $mapping) |
||
27 | |||
28 | public function getName() |
||
32 | } |
||
33 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.