Skip to content

Commit 951f478

Browse files
committed
Merge branch 'feature/squiz-blockcomment-readonly' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents cabb92a + e730d6a commit 951f478

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public function process(File $phpcsFile, $stackPtr)
9393
T_ABSTRACT => true,
9494
T_CONST => true,
9595
T_VAR => true,
96+
T_READONLY => true,
9697
];
9798
if (isset($ignore[$tokens[$nextToken]['code']]) === true) {
9899
return;

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,14 @@ final class MyClass
288288
#[AttributeB]
289289
final public function test() {}
290290
}
291+
292+
/**
293+
* Comment should be ignored.
294+
*/
295+
abstract class MyClass
296+
{
297+
/**
298+
* Comment should be ignored.
299+
*/
300+
readonly public string $prop;
301+
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,14 @@ final class MyClass
290290
#[AttributeB]
291291
final public function test() {}
292292
}
293+
294+
/**
295+
* Comment should be ignored.
296+
*/
297+
abstract class MyClass
298+
{
299+
/**
300+
* Comment should be ignored.
301+
*/
302+
readonly public string $prop;
303+
}

0 commit comments

Comments
 (0)