Commit 16d49edd authored by Klaus Purer's avatar Klaus Purer
Browse files

feat(DisallowMultipleStatements): Add sniff to detect multiple ;; statements...

feat(DisallowMultipleStatements): Add sniff to detect multiple ;; statements on one line (#3029175 by klausi)
parent a05b9d08
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@

 <rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
 <rule ref="Generic.Files.ByteOrderMark" />
 <rule ref="Generic.Formatting.DisallowMultipleStatements" />
 <rule ref="Generic.Formatting.SpaceAfterCast" />

 <rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ function example_custom_block_view($delta = '') {
  switch ($delta) {
    case 'my_block':
      //    $block['subject'] = t('custom twitter feed');
      $block['content'] = test();;
      $block['content'] = test();
      break;
  }
  return $block;
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ function example_custom_block_view($delta = '') {
  switch ($delta) {
    case 'my_block':
      // $block['subject'] = t('custom twitter feed');
      $block['content'] = test();;
      $block['content'] = test();
      break;
  }
  return $block;
+2 −1
Original line number Diff line number Diff line
@@ -375,7 +375,8 @@ class BadUnitTest extends CoderSniffUnitTest
                820 => 1,
                827 => 1,
                829 => 1,
                835 => 2,
                836 => 1,
                838 => 2,
            ];
        }//end switch

+3 −0
Original line number Diff line number Diff line
@@ -832,4 +832,7 @@ function test28() {

}

// Multiple statements on one line are not allowed.
echo 'Hi!';;

?>
 No newline at end of file
Loading