Skip to content

Commit 52f9b6e

Browse files
committed
Fix missing case.
1 parent b702ec9 commit 52f9b6e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

PSR2R/Sniffs/Classes/BraceOnSameLineSniff.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ public function process(File $phpcsFile, $stackPtr) {
5757

5858
return;
5959
}
60+
61+
if ($lastContent === $curlyBrace - 1) {
62+
$error = 'Opening brace of a %s must have one whitespace after closing parentheses';
63+
$fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceWhitespace', $errorData);
64+
if ($fix === true) {
65+
$phpcsFile->fixer->beginChangeset();
66+
$phpcsFile->fixer->addContent($lastContent, ' ');
67+
$phpcsFile->fixer->endChangeset();
68+
}
69+
}
6070
}
6171

6272
}

0 commit comments

Comments
 (0)