Skip to content

Commit c75d034

Browse files
committed
Merge branch 'php-8.0/generic-disallowyodaconditions-support-match' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents 48b3d88 + 7def79e commit c75d034

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,12 @@ if ([function() { echo 'hi'; }] === [$foo]
164164
) {
165165
}
166166

167+
echo match (5 == $num) {
168+
true => "true\n",
169+
false => "false\n"
170+
};
171+
172+
echo match ($text) {
173+
'foo' => 10 === $y,
174+
10 === $y => 'bar',
175+
};

src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ public function getErrorList()
5959
142 => 1,
6060
156 => 1,
6161
160 => 1,
62+
167 => 1,
63+
173 => 1,
64+
174 => 1,
6265
];
6366

6467
}//end getErrorList()

0 commit comments

Comments
 (0)