Skip to content

Commit

Permalink
Generic/NestingLevel: improve tests by adding more tokens
Browse files Browse the repository at this point in the history
This commit improves the tests by adding more tokens that increase the
nesting level and are already considered by the sniff, but were not
being used in the tests.
  • Loading branch information
rodrigoprimo authored and jrfnl committed Dec 10, 2024
1 parent 9794ed8 commit 9811fc5
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.1.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ function nestingFive()
function nestingSix()
{
if ($condition) {
echo 'hi';
switch ($condition)
{
} else {
switch ($condition) {
case '1':
if ($condition === '1') {
if ($cond) {
} elseif ($condition === '2') {
do {
foreach ($conds as $cond) {
echo 'hi';
}
}
} while ($cond > 5);
}
break;
}
Expand Down Expand Up @@ -79,19 +79,19 @@ function nestingEleven()
case '1':
if ($condition === '1') {
if ($cond) {
switch ($cond) {
case '1':
if ($cond === '1') {
foreach ($conds as $cond) {
if ($cond === 'hi') {
if ($cond !== 'bye') {
echo 'hi';
}
try {
if ( $cond === '1' ) {
for ( $i = 0; $i < 10; $i ++ ) {
while ($i < 5) {
if ( $cond === 'hi' ) {
match ( $cond ) {
'hi' => 'something',
};
}
}
}
break;
}
}
} catch (Exception $e) {}
}
}
break;
Expand Down

0 comments on commit 9811fc5

Please sign in to comment.