Closed ArthurKacprzak closed 2 years ago
@ArthurKacprzak I cannot reproduce this with PHPCS 3.7.0, which is the first PHPCS version with syntax support for PHP 8.1.
Please upgrade to PHPCS 3.7.0
I use phpinsights with squizlabs/php_codesniffer 3.7.0.
Side effects: (PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff)
/var/www/tmp.php:1: A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 23 and the first side effect is on line 8.
so the problem is probably insight, thank you.
It's likely that whatever tool you are using is not actually using version 3.7.0 of PHP_CodeSniffer. The error will appear on all PHP_CodeSniffer versions < 3.7.0 but I also can't replicate on 3.7.0.
Describe the bug Functions in a php Enum trigger SideEffectsSniff error
Code sample
Expected behavior An explanation of why I can't create a function in a php enum.