Closed
Description
Preconditions
Confirmed on:
- Magento 2.3.3
- PHP 7.2
- phpcs 3.4.2
Might reproduce on other versions as well, unconfirmed.
Steps to reproduce
- Prepare phpcs so that the sniffer can be run
- Create a class object with NO docblock on the class itself (example attached in comments)
- Run
phpcs --standard=Magento2 -vvv <file>
Expected result
- Expected the test result to be outputted succesfully
- (Optional) Expected a warning that a docblock is required (if this is the case?)
Actual result
- An infinite loop occurs
Last lines of output with -vvv:
Process token 72: T_NS_SEPARATOR => \
Process token 73: T_STRING => CategoryInterface
Processing Magento2\Sniffs\Functions\DiscouragedFunctionSniff... DONE in 0 seconds
Processing Magento2\Sniffs\Strings\ExecutableRegExSniff... DONE in 0 seconds
Processing Magento2\Sniffs\Security\InsecureFunctionSniff... DONE in 0 seconds
Processing PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\CallTimePassByReferenceSniff... DONE in 0 seconds
Processing PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff... DONE in 0 seconds
Processing PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff... DONE in 0 seconds
Processing PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff... DONE in 0 seconds
Processing PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff... DONE in 0 seconds
Process token 74: T_CLOSE_USE_GROUP => }
Process token 75: T_SEMICOLON => ;
Processing PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff... DONE in 0 seconds
Process token 76: T_WHITESPACE => \n
Processing Magento2\Sniffs\Whitespace\MultipleEmptyLinesSniff... DONE in 0 seconds
Processing PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff... DONE in 0 seconds
Process token 77: T_WHITESPACE => \n
Processing Magento2\Sniffs\Whitespace\MultipleEmptyLinesSniff... DONE in 0 seconds
Processing PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff... DONE in 0 seconds
Process token 78: T_ABSTRACT => abstract
Processing PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff... DONE in 0 seconds
Process token 79: T_WHITESPACE => ·
Processing Magento2\Sniffs\Whitespace\MultipleEmptyLinesSniff... DONE in 0 seconds
Processing PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff... DONE in 0 seconds
Process token 80: T_CLASS => class
Processing Magento2\Sniffs\Classes\AbstractApiSniff... ^C