Skip to content

Remove unnecessary usages of DateTime #50297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2023

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented May 11, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? no
Deprecations? no
Tickets Part of #47580
License MIT
Doc PR -

Together with #50290, this PR removes DateTime everywhere possible.

What remains is:

@nicolas-grekas nicolas-grekas force-pushed the date-immmutable branch 5 times, most recently from 3f7ba45 to 9080163 Compare May 11, 2023 09:09
@@ -93,6 +93,7 @@ public static function guessTypeProvider()
[new Type('long'), new TypeGuess(IntegerType::class, [], Guess::MEDIUM_CONFIDENCE)],
[new Type('string'), new TypeGuess(TextType::class, [], Guess::LOW_CONFIDENCE)],
[new Type(\DateTime::class), new TypeGuess(DateType::class, [], Guess::MEDIUM_CONFIDENCE)],
[new Type(\DateTimeImmutable::class), new TypeGuess(DateType::class, ['input' => 'datetime_immutable'], Guess::MEDIUM_CONFIDENCE)],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a case for \DateTimeInterface::class?

@fabpot
Copy link
Member

fabpot commented May 13, 2023

@nicolas-grekas Can you have a look at the tests, they seem broken by your changes.

@nicolas-grekas nicolas-grekas force-pushed the date-immmutable branch 2 times, most recently from 59005e7 to b551392 Compare May 13, 2023 09:44
@nicolas-grekas
Copy link
Member Author

PR ready, failures are now false-positives.

@wouterj
Copy link
Member

wouterj commented May 13, 2023

This is for 6.4 right, given we are close to RC phase?

Copy link
Member

@chalasr chalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While i'm tempted to vote 6.3 given it is the continuation a long-running work started a while ago, I think every public method signature changed in this PR deserves to be mentioned in the relevant changelog. It is likely going to impact a lot of final applications as they have to deal with that flaw and they often do it the wrong way (mostly on/because legacy code). So a whole set of beta releases wouldn't be too much either imho... we can't blame people to not test beta releases if we merge breaking changes after them, especially ones that don't bring much value from userland. I'd prefer postponing too

@nicolas-grekas
Copy link
Member Author

@chalasr UPGRADE/CHANGELOG files updated.

@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@fabpot
Copy link
Member

fabpot commented Jun 3, 2023

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 044b344 into symfony:6.4 Jun 3, 2023
@nicolas-grekas nicolas-grekas deleted the date-immmutable branch June 6, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants