Closed jrfnl closed 9 months ago
@gsherwood Could this please be earmarked for 3.8.0
?
Closing as replaced by https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/49
FYI: this fix is included in today's PHP_CodeSniffer 3.8.0 release.
As per #3932, development on PHP_CodeSniffer will continue in the PHPCSStandards/PHP_CodeSniffer repository. If you want to stay informed, you may want to start "watching" that repo (or watching releases from that repo).
PHP 8.2 | Tokenizer/PHP: allow for true in union types
Previously,
false
andnull
were already allowed in union types. As of PHP 8.2,true
has been added to the supported types in PHP and can also be used in union types. Also see: https://3v4l.org/ZpfIDThis commit adjusts the Tokenizer to correctly retokenize the
T_BITWISE_OR
character toT_UNION_TYPE
whentrue
is included in a union type.Includes unit tests.
Refs:
PHP 8.2 | File::getMethodProperties(): allow for true in types
As of PHP 8.2,
true
,false
andnull
will be allowed as stand-alone types.true
can now also be used in union types (was already allowed forfalse
andnull
). Thetrue
and thefalse
types are allowed to be nullable, thenull
type is not (but that's not the concern of this method). Also see: https://3v4l.org/ZpfIDThis commit adjusts the
File::getMethodProperties()
method to taketrue
into account.false
andnull
were already handled due to these previously already being allowed in union types.Includes unit tests.
Refs:
PHP 8.2 | File::getMethodParameters(): allow for true in types
As of PHP 8.2,
true
,false
andnull
will be allowed as stand-alone types.true
can now also be used in union types (was already allowed forfalse
andnull
). Thetrue
and thefalse
types are allowed to be nullable, thenull
type is not (but that's not the concern of this method). Also see: https://3v4l.org/ZpfIDThis commit adjusts the
File::getMethodParameters()
method to taketrue
into account.false
andnull
were already handled due to these previously already being allowed in union types.Includes unit tests.
Refs:
PHP 8.2 | File::getMemberProperties(): allow for true in types
As of PHP 8.2,
true
,false
andnull
will be allowed as stand-alone types.true
can now also be used in union types (was already allowed forfalse
andnull
). Thetrue
and thefalse
types are allowed to be nullable, thenull
type is not (but that's not the concern of this method). Also see: https://3v4l.org/ZpfIDThis commit adjusts the
File::getMemberProperties()
method to taketrue
into account.false
andnull
were already handled due to these previously already being allowed in union types.Includes unit tests.
Includes minor touch up of some pre-existing tests.
Refs:
PHP 8.2 | Generic/LowerCaseType: allow for stand-alone true/false/null
As of PHP 8.2,
true
,false
andnull
will be allowed as stand-alone types. Thetrue
and thefalse
types are allowed to be nullable, thenull
type is not (but that's not the concern of the sniff). Also see: https://3v4l.org/ZpfIDThis commit adjusts the sniff to take
true
into account.false
andnull
were already handled due to these previously already being allowed in union types.Includes unit tests.
Refs:
PHP 8.2 | PSR12/NullableTypeDeclaration: allow for nullable true/false]
As of PHP 8.2,
true
,false
andnull
will be allowed as stand-alone types. Thetrue
and thefalse
types are allowed to be nullable, thenull
type is not (but that's not the concern of the sniff). Also see: https://3v4l.org/ZpfIDThis adjusts the sniff to take these new types into account.
Includes unit tests.
Refs: