diff --git a/build/code_sniffer/phpbb/Sniffs/CodeLayout/UnionTypesCheckSniff.php b/build/code_sniffer/phpbb/Sniffs/CodeLayout/UnionTypesCheckSniff.php index 7092c07b31..89ea31efcc 100644 --- a/build/code_sniffer/phpbb/Sniffs/CodeLayout/UnionTypesCheckSniff.php +++ b/build/code_sniffer/phpbb/Sniffs/CodeLayout/UnionTypesCheckSniff.php @@ -67,6 +67,11 @@ class UnionTypesCheckSniff implements Sniff 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 { $type = substr($type_hint, 1);