mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17512] Fix handling tokens with no/empty type hint
PHPBB-17512
This commit is contained in:
parent
7a4b3f52ae
commit
c01d1967dd
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue