Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[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

Merged
merged 1 commit into from
Jun 22, 2019
Merged

[Validator] Use LogicException for missing Property Access Component in comparison constraints #32094

merged 1 commit into from
Jun 22, 2019

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.

@@ -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)));
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.