8000 [Validator] Fix wrong expression language value by yceruto · Pull Request #33831 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] Fix wrong expression language value #33831

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
Oct 3, 2019

Conversation

yceruto
Copy link
Member
@yceruto yceruto commented Oct 3, 2019
Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

public function __construct($propertyAccessor = null, ExpressionLanguage $expressionLanguage = null)

(new ExpressionValidator($propertyAccessor))->validate($object, $constraint);

Based on the previous method signature (4.3 above), that code would result in an exception in 4.4:

Call to undefined method Symfony\Component\PropertyAccess\PropertyAccessor::evaluate()

Spotted by @fancyweb in #33829 (comment)

Fixed here and updated test case to avoid regression.

@fabpot
Copy link
Member
fabpot commented Oct 3, 2019

Thank you @yceruto.

fabpot added a commit that referenced this pull request Oct 3, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Fix wrong expression language value

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

https://github.com/symfony/symfony/blob/766162c4c790cc0b91185963b9c36b842bf2eb49/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php#L28

```php
(new ExpressionValidator($propertyAccessor))->validate($object, $constraint);
```
Based on the previous method signature (4.3 above), that code would result in an exception in 4.4:
```
Call to undefined method Symfony\Component\PropertyAccess\PropertyAccessor::evaluate()
```
Spotted by @fancyweb in #33829 (comment)

Fixed here and updated test case to avoid regression.

Commits
-------

4288f1c Fix wrong expression language value
@fabpot fabpot merged commit 4288f1c into symfony:4.4 Oct 3, 2019
@yceruto yceruto deleted the ex_valid_bug branch October 4, 2019 10:58
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 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.

5 participants
0