CI: fix test failure for the VIPCS VariableAnalysis sniff #630
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.
PR #450 deprecated the VIPCS native VariableAnalysis sniff in favour of using the upstream
VariableAnalysis
standard.While the
process()
method - after throwing deprecation notices - would correctly hand off to theparent::process()
method to let the upstream sniff handle throwing the errors, theregister()
method did not defer to the parent method.This meant that the sniff would only listen to the original tokens the VIPCS native sniff was previously listening too and process those.
At the time of the switch-over, the tokens the VIPCS sniff was listening to and the tokens the VA sniff was listening to, happened to be the same.
However, in the mean time, in particularly in the VA
2.10.0
release, the tokens the VA sniff is listening to have been updated, while the VIPCS sniff was not updated to match.In practice, that meant that the VIPCS sniff was "missing" some tokens, and therefore not receiving them to
process()
.One of the checks affected, luckily, was covered by a unit test in the VIPCS sniff, which means we have now caught this issue, which could otherwise have remained in the codebase until the VIPCS native sniff was removed.
Fixed now by letting the (deprecated) VIPCS native version of the sniff defer to the upstream parent for the
register()
method as well (by removing the method in the VIPCS sniff so the call will fall through to the parent sniff).