Skip to content
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

Proper annotation for generated validator constraint #1414

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Proper annotation for generated validator constraint #1414

merged 1 commit into from
Jan 10, 2024

Conversation

zorn-v
Copy link
Contributor

@zorn-v zorn-v commented Jan 5, 2024

Currently, if you are using phpstan in your project you'll get

Access to an undefined property Symfony\Component\Validator\Constraint::$message

error on any new generated validator

Copy link
Contributor

@drieschel drieschel left a comment

Choose a reason for hiding this comment

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

I tested it and it works. 👍

Do you think it makes sense also to add the type to the $message property in src/Resources/skeleton/validator/Constraint.tpl.php in this mr?

public string $message = 'The value "{{ value }}" is not valid.';

@weaverryan
Copy link
Member

Thanks @zorn-v!

@weaverryan weaverryan merged commit 425573c into symfony:main Jan 10, 2024
5 of 7 checks passed
@jrushlow jrushlow mentioned this pull request Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants