Skip to content

Commit

Permalink
Auto-fix PEAR.Commenting.FunctionComment.SpacingAfter
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Oct 27, 2023
1 parent 8dfb632 commit 86cb183
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ public function process(File $phpcsFile, $stackPtr)
&& $tokens[$i]['line'] !== $tokens[($i + 1)]['line']
) {
$error = 'There must be no blank lines after the function comment';
$phpcsFile->addError($error, $commentEnd, 'SpacingAfter');
$fix = $phpcsFile->addFixableError($error, $commentEnd, 'SpacingAfter');

if ($fix === true) {
$phpcsFile->fixer->replaceToken($i, '');
}

break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ class Something implements JsonSerializable {
*
* @return mixed
*/

#[ReturnTypeWillChange]
public function blankLineDetectionA() {}

Expand All @@ -463,16 +462,13 @@ class Something implements JsonSerializable {
* @return mixed
*/
#[ReturnTypeWillChange]

public function blankLineDetectionB() {}

/**
* Blank line between both docblock and attribute and attribute and function declaration.
*
* @return mixed
*/

#[ReturnTypeWillChange]

public function blankLineDetectionC() {}
}

0 comments on commit 86cb183

Please sign in to comment.