Skip to content

Commit f83f191

Browse files
committed
Add PhpdocTrimConsecutiveBlankLineSeparationFixer to removes extra blank lines in PHPDoc.
1 parent 0f8e541 commit f83f191

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

ecs.php

Lines changed: 3 additions & 0 deletions
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;
@@ -371,6 +372,8 @@
371372
PhpdocScalarFixer::class,
372373
// Single line `@var` PHPDoc should have proper spacing.
373374
PhpdocSingleLineVarSpacingFixer::class,
375+
// Removes extra blank lines after summary and after description in PHPDoc.
376+
PhpdocTrimConsecutiveBlankLineSeparationFixer::class,
374377
// PHPDoc should start and end with content
375378
PhpdocTrimFixer::class,
376379
// Docblocks should only be used on structural elements.

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

Lines changed: 3 additions & 1 deletion
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

Lines changed: 5 additions & 1 deletion
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)