Skip to content

Commit 117d879

Browse files
committed
Add PhpdocTrimConsecutiveBlankLineSeparationFixer to removes extra blank lines in PHPDoc.
1 parent 8a35296 commit 117d879

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

ecs.php

+3
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
use PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer;
125125
use PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer;
126126
use PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer;
127+
use PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer;
127128
use PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer;
128129
use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer;
129130
use PhpCsFixer\Fixer\Phpdoc\PhpdocVarAnnotationCorrectOrderFixer;
@@ -372,6 +373,8 @@
372373
PhpdocScalarFixer::class,
373374
// Single line `@var` PHPDoc should have proper spacing.
374375
PhpdocSingleLineVarSpacingFixer::class,
376+
// Removes extra blank lines after summary and after description in PHPDoc.
377+
PhpdocTrimConsecutiveBlankLineSeparationFixer::class,
375378
// PHPDoc should start and end with content
376379
PhpdocTrimFixer::class,
377380
// Docblocks should only be used on structural elements.

tests/Integration/Fixtures/PhpDoc.correct.php.inc

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ class PhpDoc
1212

1313
/**
1414
* Very well documented method.
15-
* It tests PhpdocAlignFixer, NoSuperfluousPhpdocTagsFixer and possibly other Phpdoc rules.
15+
* It tests PhpdocAlignFixer, NoSuperfluousPhpdocTagsFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer
16+
* and possibly other Phpdoc rules.
17+
*
1618
* @param int|float $second Second parameter does have a comment, unlike the first one.
1719
* @param string|null $third Third parameter is optional and has a default value.
1820
* @return mixed There is also information about return type.

tests/Integration/Fixtures/PhpDoc.wrong.php.inc

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ class PhpDoc
1515

1616
/**
1717
* Very well documented method.
18-
* It tests PhpdocAlignFixer, NoSuperfluousPhpdocTagsFixer and possibly other Phpdoc rules.
18+
* It tests PhpdocAlignFixer, NoSuperfluousPhpdocTagsFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer
19+
* and possibly other Phpdoc rules.
20+
*
21+
*
22+
*
1923
* @param string $first
2024
* @throws \Exception
2125
* @param int|float $second Second parameter does have a comment, unlike the first one.

0 commit comments

Comments
 (0)