Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2.003 |
Changes | 0 |
1 | <?php |
||
48 | 1 | private function createTimeDate($from, $timezone = null) |
|
49 | { |
||
50 | 1 | if ($from === null) { |
|
51 | return null; |
||
52 | } |
||
53 | |||
54 | // Make sure it's a TimeDate instance |
||
55 | 1 | $time = \TimeDate::from($from); |
|
56 | |||
57 | 1 | return \TimeDate::create( |
|
58 | 1 | $time->year, |
|
59 | 1 | $time->month, |
|
60 | 1 | $time->day, |
|
61 | 1 | $time->hour, |
|
62 | 1 | $time->minute, |
|
63 | 1 | $time->second, |
|
64 | $timezone |
||
65 | ); |
||
66 | } |
||
67 | } |
||
68 |