4.0 | Add parameter types to all (non-test) methods by jrfnl · Pull Request #1237 · PHPCSStandards/PHP_CodeSniffer
added 15 commits
September 11, 2025 22:07This 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.
Includes changing the expected parameter type for a couple of methods from `DomNode` to `DomElement`. 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.
This commit explicitly does **not** include adding a parameter type to the `MessageCollector::add()` `$message` and `$type` parameters and the `Common::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).
This was referenced
Sep 11, 2025
jrfnl
deleted the
phpcs-4.x/feature/390-add-param-types
branch
jrfnl
mentioned this pull request
This was referenced
Sep 16, 2025This 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