Skip to content

Conversation

@Lctrs
Copy link
Contributor

@Lctrs Lctrs commented Jun 19, 2019

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.


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)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests to adjust? 🧐

Copy link
Contributor Author

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.

@ogizanagi
Copy link
Contributor

ogizanagi commented Jun 21, 2019

Hmm, it should be fixed in 3.4 actually.

@Lctrs
Copy link
Contributor Author

Lctrs commented Jun 21, 2019

Symfony\Component\Validator\Exception\LogicException has been introduced in 4.2.

@fabpot
Copy link
Member

fabpot commented Jun 22, 2019

Good catch, thanks @Lctrs.

@fabpot fabpot merged commit 6ac2316 into symfony:4.2 Jun 22, 2019
fabpot added a commit that referenced this pull request Jun 22, 2019
… 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
@Lctrs Lctrs deleted the validator/logic-exception branch June 22, 2019 17:20
This was referenced Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants