Skip to content

Add #[Attribute] annotation to validator constraints#1010

Merged
GSadee merged 1 commit intoSylius:1.12from
Rafikooo:1.12-mark-constraints-with-attributes
Apr 30, 2025
Merged

Add #[Attribute] annotation to validator constraints#1010
GSadee merged 1 commit intoSylius:1.12from
Rafikooo:1.12-mark-constraints-with-attributes

Conversation

@Rafikooo
Copy link
Copy Markdown
Contributor

@Rafikooo Rafikooo commented Apr 29, 2025

Q A
Bug fix? no
New feature? improvement
BC breaks? no
Deprecations? no
Related ticket Sylius/Sylius#17910
License MIT

According to the documentation:
https://symfony.com/doc/current/validation/custom_constraint.html
Add #[\Attribute] to the constraint class if you want to use it as an attribute in other classes.

@Rafikooo Rafikooo changed the title Add #[Attribute] annotation to validator constraints Add #[Attribute] annotation to validator constraints Apr 29, 2025
@GSadee GSadee added the Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). label Apr 30, 2025
@GSadee GSadee merged commit 82b80da into Sylius:1.12 Apr 30, 2025
20 checks passed
GSadee added a commit to Sylius/Sylius that referenced this pull request Apr 30, 2025
| Q               | A
|-----------------|-----
| Branch?         | 2.0 <!-- see the comment below -->
| Bug fix?        | no
| New feature?    | kinda (DX)
| BC breaks?      | no
| Deprecations?   | no
| Related tickets |
Sylius/SyliusResourceBundle#1010
| License         | MIT

According to the documentation:
https://symfony.com/doc/current/validation/custom_constraint.html
`Add #[\Attribute] to the constraint class if you want to use it as an
attribute in other classes.`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants