8000 remove DateTime from FrameworkBundle · symfony/symfony@03ea8ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 03ea8ff

Browse files
committed
remove DateTime from FrameworkBundle
1 parent 14f2066 commit 03ea8ff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/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');
1 3D75 27127
}
128128
}

0 commit comments

Comments
 (0)
0