Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Coding standards + changelog

  • Loading branch information...
commit 44f1655e1ad6a5eff4efbda2f838a623e5e2ee23 1 parent 9ca7282
@gsherwood gsherwood authored
View
4 CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php
@@ -28,7 +28,6 @@
class PSR2_Sniffs_ControlStructures_SwitchDeclarationSniff implements PHP_CodeSniffer_Sniff
{
-
/**
* The number of spaces code should be indented.
*
@@ -36,6 +35,7 @@ class PSR2_Sniffs_ControlStructures_SwitchDeclarationSniff implements PHP_CodeSn
*/
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
3  package.xml
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.