Describe the bug
The \PHP_CodeSniffer\Util\Common::$allowedTypes array and \PHP_CodeSniffer\Util\Common::suggestTypes() method prefer some non-normative types, including:
boolean instead of bool
integer instead of int
These aren't the types accepted by the parser for type declarations, and tooling like phpdocumentor and psalm prefer bool and int. They do accept both boolean, and integer, but then normalise to bool and int respectively.
I realise that changing to the normative types may break b/c, but they're just wrong and confusing. I suspect that the sniffs using these are not well used, in part because of these cases.
Code sample
N/A
Custom ruleset
N/A
Expected behavior
Use bool and int.
Versions (please complete the following information)
master branch
Additional context
Used in:
- src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php
- src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php
Please confirm:
Describe the bug
The
\PHP_CodeSniffer\Util\Common::$allowedTypesarray and\PHP_CodeSniffer\Util\Common::suggestTypes()method prefer some non-normative types, including:booleaninstead ofboolintegerinstead ofintThese aren't the types accepted by the parser for type declarations, and tooling like phpdocumentor and psalm prefer
boolandint. They do accept bothboolean, andinteger, but then normalise toboolandintrespectively.I realise that changing to the normative types may break b/c, but they're just wrong and confusing. I suspect that the sniffs using these are not well used, in part because of these cases.
Code sample
N/A
Custom ruleset
N/A
Expected behavior
Use
boolandint.Versions (please complete the following information)
master branch
Additional context
Used in:
Please confirm:
masterbranch of PHP_CodeSniffer.