Closed claudiu-cristea closed 2 years ago
Describe the bug
Happens after updating to PHP 8.1. In docblock a sample code is opened with @code but it's not closed, as expected, with @endcode. Let's say it was closed with @code. In this case, this line will return false:
@code
@endcode
false
$codeEnd = $phpcsFile->findNext(T_DOC_COMMENT_TAG, ($codeStart + 1), $commentEnd, false, '@endcode');
and the do {} while () block will loop forever.
do {} while ()
Code sample
<?php /** * The structure of the array is: * @code * $workflow_array = [ * 'entity_state' => [ * 'user' => [ * 'transition1', * 'transition2', * ], * ], * ]; * @code */
Custom ruleset
N/A
To reproduce
See th code sample.
PHPCS output: The process gets stuck in DocCommentLongArraySyntaxSniff
Expected behavior
To require @endcode and fail
Versions (please complete the following information):
Additional context
Sorry, the rules are from other project
Describe the bug
Happens after updating to PHP 8.1. In docblock a sample code is opened with
@code
but it's not closed, as expected, with@endcode
. Let's say it was closed with@code
. In this case, this line will returnfalse
:and the
do {} while ()
block will loop forever.Code sample
Custom ruleset
N/A
To reproduce
See th code sample.
PHPCS output: The process gets stuck in DocCommentLongArraySyntaxSniff
Expected behavior
To require
@endcode
and failVersions (please complete the following information):
Additional context