Skip to content

Commit 7c392e3

Browse files
committed
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
2 parents 29c3dc8 + e6a4174 commit 7c392e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Constraints/AbstractComparison.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\PropertyAccess\PropertyAccess;
1515
use Symfony\Component\Validator\Constraint;
1616
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
17+
use Symfony\Component\Validator\Exception\LogicException;
1718

1819
/**
1920
* Used for the comparison of values.
@@ -46,7 +47,7 @@ public function __construct($options = null)
4647
}
4748

4849
if (isset($options['propertyPath']) && !class_exists(PropertyAccess::class)) {
49-
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "propertyPath" option.', \get_class($this)));
50+
throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "propertyPath" option.', \get_class($this)));
5051
}
5152
}
5253

0 commit comments

Comments
 (0)