Skip to content

Commit

Permalink
bug #32094 [Validator] Use LogicException for missing Property Access…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
fabpot committed Jun 22, 2019
2 parents 6821850 + 6ac2316 commit 5471867
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -14,6 +14,7 @@
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.
Expand Down Expand Up @@ -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)));
}
}

Expand Down

0 comments on commit 5471867

Please sign in to comment.