From 1b1b03291fa21eacde618431483b253ddf495053 Mon Sep 17 00:00:00 2001 From: krzysztofrewak Date: Tue, 14 May 2024 13:56:25 +0200 Subject: [PATCH] #87 - no empty lines after docblocks --- src/Configuration/Defaults/CommonRules.php | 2 ++ tests/fixtures/emptyLines/actual.php | 8 ++++++++ tests/fixtures/emptyLines/expected.php | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/src/Configuration/Defaults/CommonRules.php b/src/Configuration/Defaults/CommonRules.php index 7f75ca4..cf8b77d 100644 --- a/src/Configuration/Defaults/CommonRules.php +++ b/src/Configuration/Defaults/CommonRules.php @@ -75,6 +75,7 @@ use PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer; use PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer; use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer; +use PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer; use PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer; use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer; use PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer; @@ -340,5 +341,6 @@ class CommonRules extends Rules CompactEmptyArrayFixer::class => true, ClassKeywordFixer::class => true, NamedArgumentFixer::class => true, + NoBlankLinesAfterPhpdocFixer::class => true, ]; } diff --git a/tests/fixtures/emptyLines/actual.php b/tests/fixtures/emptyLines/actual.php index fcf3915..1b08d86 100644 --- a/tests/fixtures/emptyLines/actual.php +++ b/tests/fixtures/emptyLines/actual.php @@ -2,6 +2,14 @@ declare(strict_types=1); +/** + * @property string $id + */ + +class Test +{ +} + return [ "default" => env("DB_CONNECTION", "mysql"), diff --git a/tests/fixtures/emptyLines/expected.php b/tests/fixtures/emptyLines/expected.php index 96f8225..2fe6d57 100644 --- a/tests/fixtures/emptyLines/expected.php +++ b/tests/fixtures/emptyLines/expected.php @@ -2,6 +2,13 @@ declare(strict_types=1); +/** + * @property string $id + */ +class Test +{ +} + return [ "default" => env("DB_CONNECTION", "mysql"),