-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Use LogicException for missing Property Access Component in comparison constraints #32094
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
Conversation
…in comparison constraints
@@ -46,7 +47,7 @@ public function __construct($options = null) | ||
} | ||
|
||
if (isset($options['propertyPath']) && !class_exists(PropertyAccess::class)) { | ||
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "propertyPath" option.', \get_class($this))); | ||
throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "propertyPath" 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.
No tests to adjust? 🧐
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.
Well, tests are green, no ? 😄
More seriously, it appears that the constructors of the comparison constraints are not tested atm.
|
|
Good catch, thanks @Lctrs. |
… Component in comparison constraints (Lctrs) This PR was merged into the 4.2 branch. Discussion ---------- [Validator] Use LogicException for missing Property Access Component in comparison constraints | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes-ish | New feature? | no | BC breaks? | yes-ish | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A For consistency. Commits ------- 6ac2316 [Validator] Use LogicException for missing Property Access Component in comparison constraints
For consistency.