Skip to content

[DoctrineBridge] Guess correct form types for DATE_IMMUTABLE and DATETIME_IMMUTABLE #39498

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

Closed
wants to merge 3 commits into from
Closed

[DoctrineBridge] Guess correct form types for DATE_IMMUTABLE and DATETIME_IMMUTABLE #39498

wants to merge 3 commits into from

Conversation

guillaume-sainthillier
Copy link
Contributor

@guillaume-sainthillier guillaume-sainthillier commented Dec 14, 2020

Q A
Branch? 5.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #39468
License MIT
Doc PR -

Rebased PR #39469
Fixes #39468 related to Doctrine Form Type Guesser with DateImmutable type

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@guillaume-sainthillier guillaume-sainthillier changed the title Fix #39468 issue with date immutable [DoctrineBridge] Fix bug with date immutable and datetime immutable Dec 14, 2020
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Thanks. I suppose #39469 should be closed?

use Symfony\Component\Form\Guess\ValueGuess;

class DoctrineOrmTypeGuesserTest extends TestCase
{
/**
* @dataProvider requiredType
Copy link
Member

Choose a reason for hiding this comment

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

no need for a provider here since there is only one item in the provided list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you want me to add more items to this list?

Copy link
Member

Choose a reason for hiding this comment

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

only if it makes sense to improve the code coverage
otherwise, no need for the provider

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added one more test to also cover DateTimeImmutable :-)

@guillaume-sainthillier
Copy link
Contributor Author

Yes I will close other PR then

…est.php

Co-authored-by: Jérémy Derussé <jeremy@derusse.com>
@derrabus derrabus changed the title [DoctrineBridge] Fix bug with date immutable and datetime immutable [DoctrineBridge] Guess correct form types for DATE_IMMUTABLE and DATETIME_IMMUTABLE Dec 16, 2020
@derrabus
Copy link
Member

Thank you @guillaume-sainthillier.

derrabus added a commit that referenced this pull request Dec 16, 2020
…LE and DATETIME_IMMUTABLE (guillaume-sainthillier)

This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[DoctrineBridge] Guess correct form types for DATE_IMMUTABLE and DATETIME_IMMUTABLE

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39468
| License       | MIT
| Doc PR        | -

Rebased PR #39469
Fixes #39468 related to Doctrine Form Type Guesser with DateImmutable type

Commits
-------

238d318 [DoctrineBridge] Guess correct form types for DATE_IMMUTABLE and DATETIME_IMMUTABLE
@derrabus derrabus closed this Dec 16, 2020
@fabpot fabpot mentioned this pull request Dec 18, 2020
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.

5 participants