Conditions | 4 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
40 | 13 | public static function getEarliestDate(DateTime $startDate1 = null, DateTime $date2 = null) |
|
41 | { |
||
42 | 13 | if ($startDate1 === null) { |
|
43 | 5 | return $date2; |
|
44 | } |
||
45 | |||
46 | 8 | if ($date2 === null) { |
|
47 | 3 | return $startDate1; |
|
48 | } |
||
49 | |||
50 | 5 | return $startDate1 < $date2 ? $startDate1 : $date2; |
|
51 | } |
||
52 | } |
||
53 |