Skip to content

[Validator] Add Week constraint #20110

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
Aug 26, 2024

Conversation

alexandre-daubois
Copy link
Member

Fix #20109

@alexandre-daubois
Copy link
Member Author

Silly copy-paste from me, sorry 🤦 I addressed your comments

The ``Week`` constraint was introduced in Symfony 7.2.

Validates that a string (or an object implementing the ``Stringable`` PHP interface)
matches a given week number. The week number format is defined by ISO-8601
Copy link
Contributor

Choose a reason for hiding this comment

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

what about link to wikipedia ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here you go


use Symfony\Component\Validator\Constraints as Assert;

class OnlineCourseDTO
Copy link
Contributor

Choose a reason for hiding this comment

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

entity and dto seems weird
what about removing dto ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree 👍

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

Some small comments

@javiereguiluz javiereguiluz merged commit 882245c into symfony:7.2 Aug 26, 2024
2 of 3 checks passed
@javiereguiluz
Copy link
Member

Alex, thanks a lot for contributing this nice constraint and the docs for it. Thanks to reviewers too. The contents were great but I made some minor tweaks while merging (3f0fdba). Thanks!

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