Skip to content

Commit

Permalink
Add test case with multiple statements on one line
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Jun 12, 2023
1 parent 0924523 commit 34ba861
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,10 @@ $a = new class {
}
};

// Multiple statements are still one line of unreachable code, so should get
// only one complaint from this sniff. (Well, technically two here since there
// are two 'exit()' statements above, so one complaint from each of those. So,
// two here, but not six.)
echo 'one'; echo 'two'; echo 'three';

interface MyInterface {
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function getWarningList($testFile='')
10 => 2,
14 => 1,
54 => 2,
65 => 2,
];
break;
case 'NonExecutableCodeUnitTest.3.inc':
Expand Down

0 comments on commit 34ba861

Please sign in to comment.