Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | 2 | protected static function dateFromString($date) |
|
40 | { |
||
41 | 2 | preg_match('/(\d{10})(\d{3})([\+\-]\d{4})/', $date, $matches); |
|
42 | |||
43 | 2 | if (count($matches) == 4) { |
|
44 | 1 | return Carbon::createFromFormat("U.u.O", vsprintf('%2$s.%3$s.%4$s', $matches)); |
|
45 | } |
||
46 | |||
47 | 1 | return Carbon::parse($date); |
|
48 | } |
||
49 | } |
||
50 |