You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 ofbool
integer
instead ofint
These aren't the types accepted by the parser for type declarations, and tooling like phpdocumentor and psalm prefer
bool
andint
. They do accept bothboolean
, andinteger
, but then normalise tobool
andint
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
andint
.Versions (please complete the following information)
master branch
Additional context
Used in:
Please confirm:
master
branch of PHP_CodeSniffer.The text was updated successfully, but these errors were encountered: