From 31e3e9f589be6521b76eba4460e28bc3960bdbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Mon, 19 Feb 2024 10:07:48 +0000 Subject: [PATCH] issue: DocCommentSpacingSniff - same line --- tests/Sniffs/Commenting/DocCommentSpacingSniffTest.php | 7 ++++--- .../docCommentSpacingAnnotationsGroupsErrors.fixed.php | 8 ++++++++ .../data/docCommentSpacingAnnotationsGroupsErrors.php | 5 +++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/Sniffs/Commenting/DocCommentSpacingSniffTest.php b/tests/Sniffs/Commenting/DocCommentSpacingSniffTest.php index ec9022ba8..2444b125b 100644 --- a/tests/Sniffs/Commenting/DocCommentSpacingSniffTest.php +++ b/tests/Sniffs/Commenting/DocCommentSpacingSniffTest.php @@ -159,7 +159,7 @@ public function testAnnotationsGroupsErrors(): void DocCommentSpacingSniff::CODE_INCORRECT_ORDER_OF_ANNOTATIONS_IN_GROUP, ]); - self::assertSame(13, $report->getErrorCount()); + self::assertSame(15, $report->getErrorCount()); self::assertSniffError($report, 12, DocCommentSpacingSniff::CODE_INCORRECT_ORDER_OF_ANNOTATIONS_GROUPS); self::assertSniffError($report, 23, DocCommentSpacingSniff::CODE_INCORRECT_ANNOTATIONS_GROUP); @@ -172,8 +172,9 @@ public function testAnnotationsGroupsErrors(): void self::assertSniffError($report, 95, DocCommentSpacingSniff::CODE_INCORRECT_ANNOTATIONS_GROUP); self::assertSniffError($report, 105, DocCommentSpacingSniff::CODE_INCORRECT_ANNOTATIONS_GROUP); self::assertSniffError($report, 118, DocCommentSpacingSniff::CODE_INCORRECT_ANNOTATIONS_GROUP); - self::assertSniffError($report, 133, DocCommentSpacingSniff::CODE_INCORRECT_ANNOTATIONS_GROUP); - self::assertSniffError($report, 164, DocCommentSpacingSniff::CODE_INCORRECT_ANNOTATIONS_GROUP); + self::assertSniffError($report, 125, DocCommentSpacingSniff::CODE_INCORRECT_LINES_COUNT_BETWEEN_ANNOTATIONS_GROUPS); + self::assertSniffError($report, 138, DocCommentSpacingSniff::CODE_INCORRECT_ANNOTATIONS_GROUP); + self::assertSniffError($report, 169, DocCommentSpacingSniff::CODE_INCORRECT_ANNOTATIONS_GROUP); self::assertAllFixedInFile($report); } diff --git a/tests/Sniffs/Commenting/data/docCommentSpacingAnnotationsGroupsErrors.fixed.php b/tests/Sniffs/Commenting/data/docCommentSpacingAnnotationsGroupsErrors.fixed.php index 96c5381bd..fd14e314e 100644 --- a/tests/Sniffs/Commenting/data/docCommentSpacingAnnotationsGroupsErrors.fixed.php +++ b/tests/Sniffs/Commenting/data/docCommentSpacingAnnotationsGroupsErrors.fixed.php @@ -126,6 +126,14 @@ public function phpstanReturnAndReturnAnnotations() return []; } + /** + * @see self::method() + * @link https://example.com + */ + public function sameLine() + { + } + } class Doctrine diff --git a/tests/Sniffs/Commenting/data/docCommentSpacingAnnotationsGroupsErrors.php b/tests/Sniffs/Commenting/data/docCommentSpacingAnnotationsGroupsErrors.php index 8faf82e68..54492b026 100644 --- a/tests/Sniffs/Commenting/data/docCommentSpacingAnnotationsGroupsErrors.php +++ b/tests/Sniffs/Commenting/data/docCommentSpacingAnnotationsGroupsErrors.php @@ -122,6 +122,11 @@ public function phpstanReturnAndReturnAnnotations() return []; } + /** @see self::method() @link https://example.com */ + public function sameLine() + { + } + } class Doctrine