Skip to content

Commit 6c75890

Browse files
committed
remove DateTime from FrameworkBundle
1 parent ac574f5 commit 6c75890

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Command/AboutCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ private static function formatFileSize(string $path): string
114114

115115
private static function isExpired(string $date): bool
116116
{
117-
$date = \DateTime::createFromFormat('d/m/Y', '01/'.$date);
117+
$date = \DateTimeImmutable::createFromFormat('d/m/Y', '01/'.$date);
118118

119-
return false !== $date && new \DateTime() > $date->modify('last day of this month 23:59:59');
119+
return false !== $date && new \DateTimeImmutable() > $date->modify('last day of this month 23:59:59');
120120
}
121121

122122
private static function daysBeforeExpiration(string $date): string
123123
{
124-
$date = \DateTime::createFromFormat('d/m/Y', '01/'.$date);
124+
$date = \DateTimeImmutable::createFromFormat('d/m/Y', '01/'.$date);
125125

126-
return (new \DateTime())->diff($date->modify('last day of this month 23:59:59'))->format('in %R%a days');
126+
return (new \DateTimeImmutable())->diff($date->modify('last day of this month 23:59:59'))->format('in %R%a days');
127127
}
128128
}

0 commit comments

Comments
 (0)