[composer-based] Bond AddViolationToBuildViolationRector to symfony/validator 2.5 - #983
Merged
Merged
Conversation
…alidator 2.5 The rule rewrites ExecutionContextInterface::addViolationAt() into the buildViolation() fluent builder, which the validator component added in 2.5. It now declares that constraint itself, so the composer-based set can register it once instead of leaving it to the Symfony 2.5 version set alone. The constraint names symfony/validator rather than symfony/symfony: a project installing the split components — nearly all of them today — carries no symfony/symfony to match against.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
AddViolationToBuildViolationRectorrewritesExecutionContextInterface::addViolationAt()into thebuildViolation()fluent builder:That builder arrived in the validator component in 2.5, so the rule can declare the constraint itself:
and be registered once in the composer-based set, instead of relying on the Symfony 2.5 version set to be picked up on a direct upgrade from an older version.
symfony/validator, notsymfony/symfony— a project installing the split components, which is nearly all of them today, carries nosymfony/symfonyto match against. Same package the neighbouringValidatorBuilderEnableAnnotationMappingRectorbinds to.A fixture in
tests/ComposerBased/Fixture/covers it through the set itself, so the rule being dropped from the list would fail a test rather than pass quietly.