Skip to content

Commit 1068518

Browse files
committed
Squiz/ComparisonOperatorUsage: handle FQN true/false/null
This commit fixes the sniff to handle "fully qualified true/false" the same as unqualified true/false. Includes tests.
1 parent 9cc75d3 commit 1068518

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,9 @@ if (empty($argTags > 0)) {
136136
}
137137

138138
myFunction($var1 === true ? "" : "foobar");
139+
140+
// Verify that FQN true/false are handled the same as unqualified.
141+
if (true) {}
142+
if (\true) {}
143+
for ($var1 = 10; FALSE; $var1--) {}
144+
for ($var1 = 10; \FALSE; $var1--) {}

0 commit comments

Comments
 (0)