diff --git a/ecs.php b/ecs.php index 4f7784f..60049c6 100644 --- a/ecs.php +++ b/ecs.php @@ -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; @@ -371,6 +372,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. diff --git a/tests/Integration/Fixtures/PhpDoc.correct.php.inc b/tests/Integration/Fixtures/PhpDoc.correct.php.inc index ce63f91..b680816 100644 --- a/tests/Integration/Fixtures/PhpDoc.correct.php.inc +++ b/tests/Integration/Fixtures/PhpDoc.correct.php.inc @@ -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. diff --git a/tests/Integration/Fixtures/PhpDoc.wrong.php.inc b/tests/Integration/Fixtures/PhpDoc.wrong.php.inc index 1680520..a13aede 100644 --- a/tests/Integration/Fixtures/PhpDoc.wrong.php.inc +++ b/tests/Integration/Fixtures/PhpDoc.wrong.php.inc @@ -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.