Fix a number of apparent bugs and minor clean-up. #138
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.
On a whim, I've run the codebase through Scrutinizer (without any specific config) and this threw up some interesting findings.
This PR handles most of these (for the sniff files).
Typical issues found & handled in this PR:
false
from theprocess()
method. This is wrong. If the process method returns something it will be interpreted as an integer stack position to continue checking from, so returning false could lead to race conditions.Also:
One thing Scrutinizer threw up which is not (yet) handled is the following from the
BaseSniffTest.php
file:The
PHP_CodeSniffer_CLI
class does not have asettingsStandard
property, so this code is effectively useless. All the same, I imagine something like this does need to be done, so someone more familiar with the original intend of this code might want to have a look at what this should be replaced with.