diff --git a/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php b/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php index fa8674a..3105b19 100644 --- a/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php +++ b/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php @@ -119,7 +119,7 @@ public function process(File $phpcsFile, $stackPtr) && $tokens[$commentEnd]['code'] !== T_COMMENT ) { $previous = $commentEnd; - if ( + while ( $tokens[$commentEnd]['code'] === T_ATTRIBUTE_END || $tokens[$commentEnd]['code'] === T_ATTRIBUTE ) { diff --git a/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc b/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc index b6f911e..3b01d6d 100644 --- a/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc +++ b/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc @@ -239,4 +239,17 @@ class Foo public function returnWillChange($param, $otherParam) { } + + /** + * Some sentence. + * + * @param int $param Some Param. + * @param bool $otherParam Some Other Param. + * @return string Something. + */ + #[ReturnTypeWillChange] + #[NoDiscard] + public function withMultipleAttributes($param, $otherParam) + { + } } diff --git a/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc.fixed index 2d765c6..3d84927 100644 --- a/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc.fixed +++ b/CakePHP/Tests/Commenting/FunctionCommentUnitTest.inc.fixed @@ -239,4 +239,17 @@ class Foo public function returnWillChange($param, $otherParam) { } + + /** + * Some sentence. + * + * @param int $param Some Param. + * @param bool $otherParam Some Other Param. + * @return string Something. + */ + #[ReturnTypeWillChange] + #[NoDiscard] + public function withMultipleAttributes($param, $otherParam) + { + } }