Permalink
Browse files

Coding standards + changelog

  • Loading branch information...
1 parent 9ca7282 commit 44f1655e1ad6a5eff4efbda2f838a623e5e2ee23 @gsherwood gsherwood committed Feb 18, 2013
Showing with 5 additions and 2 deletions.
  1. +2 −2 CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php
  2. +3 −0 package.xml
@@ -28,14 +28,14 @@
class PSR2_Sniffs_ControlStructures_SwitchDeclarationSniff implements PHP_CodeSniffer_Sniff
{
-
/**
* The number of spaces code should be indented.
*
* @var int
*/
public $indent = 4;
+
/**
* Returns an array of tokens this test wants to listen for.
*
@@ -94,7 +94,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
}
if ($tokens[$nextCase]['column'] !== $caseAlignment) {
- $error = strtoupper($type).' keyword must be indented ' . $this->indent . ' spaces from SWITCH keyword';
+ $error = strtoupper($type).' keyword must be indented '.$this->indent.' spaces from SWITCH keyword';
$phpcsFile->addError($error, $nextCase, $type.'Indent');
}
View
@@ -26,6 +26,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
</stability>
<license uri="https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt">BSD 3-Clause License</license>
<notes>
+ - PSR2 SwitchDeclarationSniff now has a setting to specify how many spaces code should be indented
+ -- Default remains at 4; override the indent setting in a ruleset.xml file to change
+ -- Thanks to Asher Snyder for the patch
- Fixed bug #19819 : Freeze with syntax error in use statement
- Fixed bug #19820 : Wrong message level in Generic_Sniffs_CodeAnalysis_EmptyStatementSniff
</notes>

0 comments on commit 44f1655

Please sign in to comment.