mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-29 04:50:51 +02:00
[ticket/17512] Fix handling tokens with no/empty type hint
PHPBB-17512
This commit is contained in:
@@ -67,6 +67,11 @@ class UnionTypesCheckSniff implements Sniff
|
|||||||
|
|
||||||
public function check_union_type(File $phpcsFile, $stack_pointer, $type_hint)
|
public function check_union_type(File $phpcsFile, $stack_pointer, $type_hint)
|
||||||
{
|
{
|
||||||
|
if (empty($type_hint))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!strpos($type_hint, '|') && $type_hint[0] == '?') // Check nullable shortcut syntax
|
if (!strpos($type_hint, '|') && $type_hint[0] == '?') // Check nullable shortcut syntax
|
||||||
{
|
{
|
||||||
$type = substr($type_hint, 1);
|
$type = substr($type_hint, 1);
|
||||||
|
Reference in New Issue
Block a user