Skip to content

Commit 4010b60

Browse files
committed
PHP 8.1: Squiz/InlineComment - Enums should be ignored
1 parent 18d03c4 commit 4010b60

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function process(File $phpcsFile, $stackPtr)
7474
T_CLASS,
7575
T_INTERFACE,
7676
T_TRAIT,
77+
T_ENUM,
7778
T_FUNCTION,
7879
T_CLOSURE,
7980
T_PUBLIC,

src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,11 @@ final class MyClass
173173
*/
174174

175175
// For this test line having an empty line below it, is fine.
176+
177+
/**
178+
* Comment should be ignored.
179+
*
180+
*/
181+
enum MyEnum {
182+
183+
}

src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,11 @@ final class MyClass
166166
*/
167167

168168
// For this test line having an empty line below it, is fine.
169+
170+
/**
171+
* Comment should be ignored.
172+
*
173+
*/
174+
enum MyEnum {
175+
176+
}

0 commit comments

Comments
 (0)