bug #32094 [Validator] Use LogicException for missing Property Access 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
-------
6ac2316993
[Validator] Use LogicException for missing Property Access Component in comparison constraints
This commit is contained in:
commit
5471867efc
|
@ -14,6 +14,7 @@ namespace Symfony\Component\Validator\Constraints;
|
|||
use Symfony\Component\PropertyAccess\PropertyAccess;
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
|
||||
use Symfony\Component\Validator\Exception\LogicException;
|
||||
|
||||
/**
|
||||
* Used for the comparison of values.
|
||||
|
@ -46,7 +47,7 @@ abstract class AbstractComparison extends Constraint
|
|||
}
|
||||
|
||||
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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue