| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public static function convertDateTimeToImmutable(\DateTimeInterface $date): \DateTimeImmutable |
||
| 28 | { |
||
| 29 | $result = null; |
||
| 30 | |||
| 31 | if ($date instanceof \DateTime) { |
||
| 32 | $result = \DateTimeImmutable::createFromMutable($date); |
||
| 33 | } elseif ($date instanceof \DateTimeImmutable) { |
||
| 34 | $result = $date; |
||
| 35 | } |
||
| 36 | |||
| 37 | return $result; |
||
| 38 | } |
||
| 39 | } |
||
| 40 |