Skip to content

Commit

Permalink
Fixed bug #2878 : PSR12.Files.FileHeader conflicts with Generic.Files…
Browse files Browse the repository at this point in the history
….LineEndings
  • Loading branch information
gsherwood committed Mar 8, 2020
1 parent af90533 commit bbd01df
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,7 @@ public function processHeaderLines(File $phpcsFile, $headerLines)
$fix = $phpcsFile->addFixableError($error, $line['end'], 'SpacingAfterBlock');
if ($fix === true) {
if ($tokens[$next]['line'] === $tokens[$line['end']]['line']) {
$phpcsFile->fixer->addNewlineBefore($next);
$phpcsFile->fixer->addNewlineBefore($next);
$phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar);
} else if ($tokens[$next]['line'] === ($tokens[$line['end']]['line'] + 1)) {
$phpcsFile->fixer->addNewline($line['end']);
} else {
Expand Down

0 comments on commit bbd01df

Please sign in to comment.