Skip to content

Commit

Permalink
Add PhpdocTrimConsecutiveBlankLineSeparationFixer to removes extra bl…
Browse files Browse the repository at this point in the history
…ank lines in PHPDoc.
  • Loading branch information
OndraM committed May 23, 2024
1 parent 8a35296 commit 117d879
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
use PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocVarAnnotationCorrectOrderFixer;
Expand Down Expand Up @@ -372,6 +373,8 @@
PhpdocScalarFixer::class,
// Single line `@var` PHPDoc should have proper spacing.
PhpdocSingleLineVarSpacingFixer::class,
// Removes extra blank lines after summary and after description in PHPDoc.
PhpdocTrimConsecutiveBlankLineSeparationFixer::class,
// PHPDoc should start and end with content
PhpdocTrimFixer::class,
// Docblocks should only be used on structural elements.
Expand Down
4 changes: 3 additions & 1 deletion tests/Integration/Fixtures/PhpDoc.correct.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class PhpDoc

/**
* Very well documented method.
* It tests PhpdocAlignFixer, NoSuperfluousPhpdocTagsFixer and possibly other Phpdoc rules.
* It tests PhpdocAlignFixer, NoSuperfluousPhpdocTagsFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer
* and possibly other Phpdoc rules.
*
* @param int|float $second Second parameter does have a comment, unlike the first one.
* @param string|null $third Third parameter is optional and has a default value.
* @return mixed There is also information about return type.
Expand Down
6 changes: 5 additions & 1 deletion tests/Integration/Fixtures/PhpDoc.wrong.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ class PhpDoc

/**
* Very well documented method.
* It tests PhpdocAlignFixer, NoSuperfluousPhpdocTagsFixer and possibly other Phpdoc rules.
* It tests PhpdocAlignFixer, NoSuperfluousPhpdocTagsFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer
* and possibly other Phpdoc rules.
*
*
*
* @param string $first
* @throws \Exception
* @param int|float $second Second parameter does have a comment, unlike the first one.
Expand Down

0 comments on commit 117d879

Please sign in to comment.