Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug #19820 : Wrong message level in Generic_Sniffs_CodeAnalysis…

…_EmptyStatementSniff
  • Loading branch information...
commit 44f7cc86ea688f2726ce5c798bfecf960c5ad5cc 1 parent c3dc904
@gsherwood gsherwood authored
View
22 CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php
@@ -53,16 +53,16 @@ class Generic_Sniffs_CodeAnalysis_EmptyStatementSniff implements PHP_CodeSniffer
* @var array
*/
protected $checkedTokens = array(
- T_CATCH => true,
- T_DO => false,
- T_ELSE => false,
- T_ELSEIF => false,
- T_FOR => false,
- T_FOREACH => false,
- T_IF => false,
- T_SWITCH => false,
- T_TRY => false,
- T_WHILE => false,
+ T_CATCH => false,
+ T_DO => true,
+ T_ELSE => true,
+ T_ELSEIF => true,
+ T_FOR => true,
+ T_FOREACH => true,
+ T_IF => true,
+ T_SWITCH => true,
+ T_TRY => true,
+ T_WHILE => true,
);
@@ -125,4 +125,4 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
}//end class
-?>
+?>
View
30 CodeSniffer/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.php
@@ -42,8 +42,17 @@ class Generic_Tests_CodeAnalysis_EmptyStatementUnitTest extends AbstractSniffUni
public function getErrorList()
{
return array(
- 64 => 1,
- 68 => 1,
+ 3 => 1,
+ 15 => 1,
+ 17 => 1,
+ 19 => 1,
+ 30 => 1,
+ 35 => 1,
+ 41 => 1,
+ 47 => 1,
+ 52 => 1,
+ 55 => 1,
+ 72 => 2,
);
}//end getErrorList()
@@ -60,22 +69,13 @@ public function getErrorList()
public function getWarningList()
{
return array(
- 3 => 1,
- 15 => 1,
- 17 => 1,
- 19 => 1,
- 30 => 1,
- 35 => 1,
- 41 => 1,
- 47 => 1,
- 52 => 1,
- 55 => 1,
- 72 => 2,
- );
+ 64 => 1,
+ 68 => 1,
+ );
}//end getWarningList()
}//end class
-?>
+?>
View
1  package.xml
@@ -27,6 +27,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<license uri="https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt">BSD 3-Clause License</license>
<notes>
- Fixed bug #19819 : Freeze with syntax error in use statement
+ - Fixed bug #19820 : Wrong message level in Generic_Sniffs_CodeAnalysis_EmptyStatementSniff
</notes>
<contents>
<dir name="/">
Please sign in to comment.
Something went wrong with that request. Please try again.