-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Allow to use property paths to get limits in range constraint #31511
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
[Validator] Allow to use property paths to get limits in range constraint #31511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as suggested in #31526: when provided, adding the paths as parameters in the violation can be useful.
@ogizanagi Done. |
Rebased on |
Failure in |
} | ||
|
||
if ((isset($options['minPropertyPath']) || isset($options['maxPropertyPath'])) && !class_exists(PropertyAccess::class)) { | ||
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "minPropertyPath" or "maxPropertyPath" option.', \get_class($this))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Symfony\Component\Validator\Exception\LogicException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Lctrs. |
…in range constraint (Lctrs) This PR was squashed before being merged into the 4.4 branch (closes #31511). Discussion ---------- [Validator] Allow to use property paths to get limits in range constraint | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | Part of #31503 | License | MIT | Doc PR | symfony/symfony-docs#11793 Similar as #22576, but for the `Range` constraint. Commits ------- 2b50990 [Validator] Allow to use property paths to get limits in range constraint
This PR was merged into the 4.4 branch. Discussion ---------- [Validator] Fix Changelog for #31511 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A Commits ------- 9d72505 [Validator] Fix Changelog for #31511
…traint (Lctrs) This PR was squashed before being merged into the 4.4 branch (closes #11793). Discussion ---------- Document the new property path options of the Range constraint Related PR : symfony/symfony#31511 Commits ------- 08e724c Document the new property path options of the Range constraint
* 4.4: (53 commits) Fix Twig 1.x compatibility Deprecating templateExists method [Translator] Improve farsi(persian) translations for Form [Validator] Fix Changelog for #31511 [Lock][Console] bump lock requirement in console [Lock] minor: add missing alias for PersistenStoreInterface Improve fa translations Dynamic bundle assets [Lock] rename and deprecate Factory into LockFactory [Debug] Restoring back the state of the Debug component (1st step) Spell "triggering" properly [Lock] Fix tests Added tests to cover the possibility of having scalars as services. fixed CS [Lock] Split \"StoreInterface\" into multiple interfaces with less responsability [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit [Validator] Allow to use property paths to get limits in range constraint Fix missing deprecations fixed tests on old PHP versions [FrameworkBundle] Inform the user when save_path will be ignored ...
* 4.4: (53 commits) Fix Twig 1.x compatibility Deprecating templateExists method [Translator] Improve farsi(persian) translations for Form [Validator] Fix Changelog for symfony#31511 [Lock][Console] bump lock requirement in console [Lock] minor: add missing alias for PersistenStoreInterface Improve fa translations Dynamic bundle assets [Lock] rename and deprecate Factory into LockFactory [Debug] Restoring back the state of the Debug component (1st step) Spell "triggering" properly [Lock] Fix tests Added tests to cover the possibility of having scalars as services. fixed CS [Lock] Split \"StoreInterface\" into multiple interfaces with less responsability [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit [Validator] Allow to use property paths to get limits in range constraint Fix missing deprecations fixed tests on old PHP versions [FrameworkBundle] Inform the user when save_path will be ignored ...
Similar as #22576, but for the
Range
constraint.