Skip to content

Commit 6d0b296

Browse files
committed
feature #47730 Ban DateTime from the codebase (WebMamba)
This PR was squashed before being merged into the 6.2 branch. Discussion ---------- Ban DateTime from the codebase | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | #47580 | License | MIT | Doc PR | symfony As discuss in this issue, the purpose of this PR is to remove DateTime from the code base in favor to DateTimeImmutable. I will process it component by component. Feel free to discuss! Commits ------- 689385a83f Ban DateTime from the codebase
2 parents f26df6e + 9e671ae commit 6d0b296

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/ResponseTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,17 +796,17 @@ public function testIsImmutable()
796796
public function testSetDate()
797797
{
798798
$response = new Response();
799-
$response->setDate(\DateTime::createFromFormat(\DateTime::ATOM, '2013-01-26T09:21:56+0100', new \DateTimeZone('Europe/Berlin')));
799+
$response->setDate(\DateTime::createFromFormat(\DateTimeInterface::ATOM, '2013-01-26T09:21:56+0100', new \DateTimeZone('Europe/Berlin')));
800800

801-
$this->assertEquals('2013-01-26T08:21:56+00:00', $response->getDate()->format(\DateTime::ATOM));
801+
$this->assertEquals('2013-01-26T08:21:56+00:00', $response->getDate()->format(\DateTimeInterface::ATOM));
802802
}
803803

804804
public function testSetDateWithImmutable()
805805
{
806806
$response = new Response();
807-
$response->setDate(\DateTimeImmutable::createFromFormat(\DateTime::ATOM, '2013-01-26T09:21:56+0100', new \DateTimeZone('Europe/Berlin')));
807+
$response->setDate(\DateTimeImmutable::createFromFormat(\DateTimeInterface::ATOM, '2013-01-26T09:21:56+0100', new \DateTimeZone('Europe/Berlin')));
808808

809-
$this->assertEquals('2013-01-26T08:21:56+00:00', $response->getDate()->format(\DateTime::ATOM));
809+
$this->assertEquals('2013-01-26T08:21:56+00:00', $response->getDate()->format(\DateTimeInterface::ATOM));
810810
}
811811

812812
public function testSetExpires()

0 commit comments

Comments
 (0)