8000 [Validator] Allow single integer for the `versions` option of the `Uuid` constraint by alexandre-daubois · Pull Request #50396 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] Allow single integer for the versions option of the Uuid constraint #50396

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

Conversation

alexandre-daubois
Copy link
Member
@alexandre-daubois alexandre-daubois commented May 23, 2023
Q A
Branch? 6.4
Bug fix? no
New feature? yes
Deprecations? yes
Tickets NA
License MIT
Doc PR Todo

Improve DX by allowing to pass a single integer for the versions option of the Uuid constraint

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "6.3" but it seems your PR description refers to branch "6.4 after feature freeze".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@alexandre-daubois alexandre-daubois changed the base branch from 6.4 to 7.0 May 25, 2023 08:49
@alexandre-daubois alexandre-daubois force-pushed the uuid-single-integer-version branch from 4e568c1 to 51df710 Compare May 25, 2023 08:49
@xabbuh xabbuh changed the base branch from 7.0 to 6.4 May 25, 2023 11:28
@xabbuh xabbuh changed the base branch from 6.4 to 7.0 May 25, 2023 11:28
@xabbuh
Copy link
Member
xabbuh commented May 25, 2023

@alexandre-daubois Can you rebase on the 6.4 branch?

@alexandre-daubois alexandre-daubois force-pushed the uuid-single-integer-version branch from 7e4a84d to 3f52000 Compare May 25, 2023 11:55
@fabpot
Copy link
Member
fabpot commented Jun 3, 2023

I'm not sure I like this change. The argument is named versions, so I would not expect a single integer to be supported.

@nicolas-grekas
Copy link
Member

The argument is named versions, so I would not expect a single integer to be supported.

There is a least one precedent on the topic, Route's schemes + methods accept a single value:
https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/Routing/Annotation/Route.php#L44-L45

@alexandre-daubois
Copy link
Member Author

I actually found some other examples. Many other constraints accept array|string:

This PR (and this one) could bring some consistency here in my opnion 🙂

@nicolas-grekas
Copy link
Member

Thank you @alexandre-daubois.

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.

6 participants
0