8000 minor #47937 [FrameworkBundle] remove DateTime from core Bundles (Web… · symfony/symfony@823f332 · GitHub
[go: up one dir, main page]

Skip to content

Commit 823f332

Browse files
committed
minor #47937 [FrameworkBundle] remove DateTime from core Bundles (WebMamba)
This PR was merged into the 6.2 branch. Discussion ---------- [FrameworkBundle] remove DateTime from core Bundles | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | #47580 | License | MIT | Doc PR | symfony/symfony-docs Remove DateTime from all core bundles. Find also some DateTime in the SecurityBundle, but expose to BC breaks so will be treated in another PR. Commits ------- 03ea8ff remove DateTime from FrameworkBundle
2 parents d0dc7b2 + 03ea8ff commit 823f332

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( 44AC $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)
0