| Conditions | 4 |
| Paths | 4 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | private function tryToGetDateObjFromString($obj) { |
||
| 17 | try { |
||
| 18 | $date = new \DateTime($obj); |
||
| 19 | if ($date->format('Y-m-d H:i:s') == substr($obj, 0, 20) || $date->format('Y-m-d') == substr($obj, 0, 10)) $obj = $date; |
||
| 20 | } |
||
| 21 | catch (\Exception $e) { //Doesn't need to do anything as the try/catch is working out whether $obj is a date |
||
| 22 | } |
||
| 23 | return $obj; |
||
| 24 | } |
||
| 44 |