Skip to content
New issue

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

Fatal Error on PHP 7.4 #108

Closed
aik099 opened this issue Aug 20, 2023 · 1 comment
Closed

Fatal Error on PHP 7.4 #108

aik099 opened this issue Aug 20, 2023 · 1 comment
Labels

Comments

@aik099
Copy link
Owner

aik099 commented Aug 20, 2023

When standard executed using PHP_CodeSniffer 3.5.7 using PHP 7.4, then I got this Fatal Error:

phpcs: PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function CodingStandard\Sniffs\Commenting\TypeCommentStructure::__construct(), 0 passed in /Users/alex/.composer/vendor/squizlabs/php_codesniffer/src/Ruleset.php on line 1209 and exactly 2 expected in /Volumes/web/g/console-helpers/svn-buddy/vendor/aik099/coding-standard/CodingStandard/Sniffs/Commenting/TypeCommentSniff.php:608 Stack trace: #0 /Users/alex/.composer/vendor/squizlabs/php_codesniffer/src/Ruleset.php(1209): CodingStandard\Sniffs\Commenting\TypeCommentStructure->__construct() #1 /Users/alex/.composer/vendor/squizlabs/php_codesniffer/src/Ruleset.php(218): PHP_CodeSniffer\Ruleset->populateTokenListeners() #2 /Users/alex/.composer/vendor/squizlabs/php_codesniffer/src/Runner.php(332): PHP_CodeSniffer\Ruleset->__construct(Object(PHP_CodeSniffer\Config)) #3 /Users/alex/.composer/vendor/squizlabs/php_codesniffer/src/Runner.php(70): PHP_CodeSniffer\Runner->init() #4 /Users/alex/.composer/vendor/squizlabs/php_codesniffer/bin/phpcs(17): PHP_CodeSniffer\Runne in /Volumes/web/g/console-helpers/svn-buddy/vendor/aik099/coding-standard/CodingStandard/Sniffs/Commenting/TypeCommentSniff.php on line 608  

It seems, that PHP_CodeSniffer treats the TypeCommentStructure class as a sniff and tries to execute it. Likely this was happening on the PHP 7.2 as well, but in there PHP haven't complained about invoking class without arguments.

@aik099
Copy link
Owner Author

aik099 commented Dec 5, 2023

The problem was happening only on the PHP_CodeSniffer 3.5.6 version. Please update to next available version.

@aik099 aik099 closed this as completed Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant