[Validator] Remove calls to non-existing method #17357
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes some useless code after #16024.
1. ConstraintValidator::buildViolation() marked as deprecated in 2.8, and has been removed in 3.0.
But all the
Symfony/Component/Validator/Constraints/*
validators still making calls to this parent method.2. Correct me if I'm wrong, but this condition:
in the
Symfony/Component/Validator/Constraints/*
validators is useless since 3.0, because the$context
can only beExecutionContextInterface
. I guess the porpuse of this condition was, that in 2.8 there was a legacy interface too.And AFAIK, the
$context
is always initialized before validation, so no need to check that$context
is whether null or not.3. The return value of ExecutionContextInterface::getViolations(), is in a different namespace, so it should be used.