We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Fatal error when a method has a line in DocBlock "@param $code" (Doctrine standard).
Code sample
class TestCase { /** * @param $code * * @return bool */ private function interpretStatus($code) { switch ($code) { case '1': case '2': case '3': case '4': case '6': return '1'; case '7': case '9': return '0'; } return false; } }
To reproduce Steps to reproduce the behavior:
test.php
phpcs --standard=Doctrine test.php
PHPCS output here
Fatal error: Uncaught TypeError: SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation::__construct(): Argument #5 ($contentNode) must be of type ?PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode, PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode given, called in /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php on line 357 and defined in /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterAnnotation.php:31 Stack trace: #0 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php(357): SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation->__construct('@param', 14, 16, '$code', Object(PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode)) #1 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php(42): SlevomatCodingStandard\Helpers\AnnotationHelper::SlevomatCodingStandard\Helpers\{closure}() #2 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php(31): SlevomatCodingStandard\Helpers\SniffLocalCache::setIfNotCached(0, '/Users/kirilcve...', Object(Closure)) #3 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php(372): SlevomatCodingStandard\Helpers\SniffLocalCache::getAndSetIfNotCached(Object(PHP_CodeSniffer\Files\LocalFile), 'annotations-9', Object(Closure)) #4 /Users/kirilcvetkov/.composer/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php(680): SlevomatCodingStandard\Helpers\AnnotationHelper::getAnnotations(Object(PHP_CodeSniffer\Files\LocalFile), 9) #5 /Users/kirilcvetkov/.composer/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php(145): SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff->getReferences(Object(PHP_CodeSniffer\Files\LocalFile), 0) #6 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/squizlabs/php_codesniffer/src/Files/File.php(498): SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff->process(Object(PHP_CodeSniffer\Files\LocalFile), 0) #7 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php(92): PHP_CodeSniffer\Files\File->process() #8 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/squizlabs/php_codesniffer/src/Runner.php(628): PHP_CodeSniffer\Files\LocalFile->process() #9 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/squizlabs/php_codesniffer/src/Runner.php(434): PHP_CodeSniffer\Runner->processFile(Object(PHP_CodeSniffer\Files\LocalFile)) #10 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/squizlabs/php_codesniffer/src/Runner.php(114): PHP_CodeSniffer\Runner->run() #11 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/squizlabs/php_codesniffer/bin/phpcs(18): PHP_CodeSniffer\Runner->runPHPCS() #12 /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/bin/phpcs(120): include('/System/Volumes...') #13 {main} thrown in /System/Volumes/Data/Users/kirilcvetkov/.composer/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterAnnotation.php on line 31
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered:
Duplicate of #1384
Sorry, something went wrong.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
Describe the bug
Fatal error when a method has a line in DocBlock "@param $code" (Doctrine standard).
Code sample
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs --standard=Doctrine test.php
PHPCS output here
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: