You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a readonly class in php 8.2 and PHP_CodeSniffer shows a warning:
FILE: src/AutowireHelper.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | WARNING | 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
| | 9 and the first side effect is on line 9.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> ./vendor/bin/phpcs --standard=phpcs.xml ./src/
FILE: src/AutowireHelper.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | WARNING | 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
| | 9 and the first side effect is on line 9.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Time: 40ms; Memory: 6MB
Expected behavior
A clear and concise description of what you expected to happen.
Versions (please complete the following information):
OS: Ubuntu 20.04
PHP: 8.2
PHPCS: 3.7.1
Standard: custom, see xml file above
The text was updated successfully, but these errors were encountered:
Describe the bug
I have a readonly class in php 8.2 and PHP_CodeSniffer shows a warning:
Removing
readonly
keyword helps to fix the issue.Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
phpcs A.php ...
Expected behavior
A clear and concise description of what you expected to happen.
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: