Skip to content

Commit

Permalink
PSR2.ControlStructures.SwitchDeclaration now produces a distinct code…
Browse files Browse the repository at this point in the history
… when body is not on line following statement.
  • Loading branch information
mikesherov committed Oct 17, 2015
1 parent 0597a4d commit f2454c6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)

if ($tokens[$next]['line'] !== ($tokens[$opener]['line'] + 1)) {
$error = 'The '.strtoupper($type).' body must start on the line following the statement';
$fix = $phpcsFile->addFixableError($error, $nextCase, 'SpaceBeforeColon'.strtoupper($type));
$fix = $phpcsFile->addFixableError($error, $nextCase, 'BodyOnNextLine'.strtoupper($type));
if ($fix === true) {
if ($tokens[$next]['line'] === $tokens[$opener]['line']) {
$padding = str_repeat(' ', ($caseAlignment + $this->indent - 1));
Expand Down

0 comments on commit f2454c6

Please sign in to comment.