Skip to content

Commit 90cc33c

Browse files
committed
Handle unions
1 parent 922564f commit 90cc33c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

VariableAnalysis/Lib/Helpers.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,18 @@ private static function isTokenPossiblyPartOfTypehint(File $phpcsFile, $stackPtr
15841584
if ($token['code'] === T_STRING) {
15851585
return true;
15861586
}
1587+
if ($token['code'] === T_TRUE) {
1588+
return true;
1589+
}
1590+
if ($token['code'] === T_FALSE) {
1591+
return true;
1592+
}
1593+
if ($token['code'] === T_NULL) {
1594+
return true;
1595+
}
1596+
if ($token['type'] === 'T_TYPE_UNION') {
1597+
return true;
1598+
}
15871599
if (in_array($token['code'], Tokens::$emptyTokens)) {
15881600
return true;
15891601
}

0 commit comments

Comments
 (0)