Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e948b07

Browse files
committed
Add PhpdocTrimConsecutiveBlankLineSeparationFixer to removes extra blank lines in PHPDoc.
1 parent 8b17b23 commit e948b07

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;
@@ -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‎

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)

AltStyle によって変換されたページ (->オリジナル) /