4.0 | Add parameter types to all (non-test) methods #1237
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.
Description
4.0 | PHPCS Framework classes: add parameter types
4.0 | Files: add parameter types
This commit explicitly does not include adding a parameter type to the
File::getTokensAsString()
$start
and$length
parameters as the pre-existing inline parameter validation is more comprehensive and more reliable.4.0 | Filters: add parameter types
4.0 | Generators: add parameter types
Includes changing the expected parameter type for a couple of methods from
DomNode
toDomElement
.The previous was incorrect, but changing the method signature by making a type more specific, is a breaking change, so had to wait until now.
4.0 | Reports: add parameter types
4.0 | Tokenizers: add parameter types
4.0 | Util classes: add parameter types
This commit explicitly does not include adding a parameter type to the
MessageCollector::add()
$message
and$type
parameters and theCommon::getSniffCode()
$sniffsClass
parameter, as the pre-existing inline parameter validation is more comprehensive and more reliable.Includes removing a type check from an "internal-only" class which is no longer necessary (and updating the associated test).
4.0 | (Abstract) Sniff classes: add parameter types
4.0 | Standards/Generic: add parameter types to sniffs
4.0 | Standards/PEAR: add parameter types to sniffs
4.0 | Standards/PSR: add parameter types to sniffs
4.0 | Standards/Squiz: add parameter types to sniffs
4.0 | Standards/Zend: add parameter types to sniffs
4.0 | Tests: add parameter types to sniffs used as test fixtures
4.0 | AbstractSniffTestCase: add parameter types
Includes updating the sniff test classes overloading these methods.
Suggested changelog entry
Related issues/external references
Fixes #390