Describe the bug
Running ~/.composer/vendor/bin/phpcs -p . --standard=PHPCompatibility --runtime-set testVersion 8.5 on my codebase.
I get the error ""$this" can no longer be unset since PHP 7.1.", but this is not what is happening in the code, see the offending line below.
Code sample
unset(static::$_cached_objects[get_called_class()][static::implode_pk($this)]);
To reproduce
Steps to reproduce the behavior:
- Create a php file containing the given line
- Run phpcs with the given line
- See error message displayed
---------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------
1730 | ERROR | "$this" can no longer be unset since PHP 7.1.
---------------------------------------------------------------------------------
Expected behavior
Not being shown this error, $this is not being unset on this line, it is used as an argument to a function.
Versions (please complete the following information)
|
|
| Operating System |
[e.g., Windows 10, MacOS 10.15] |
| PHP version |
[8.5.0] |
| PHP_CodeSniffer version |
[3.13.5 stable] |
| Standard |
PHPCompatibility] |
| Install type |
Composer, local] |
Additional context
Add any other context about the problem here.
Please confirm:
Describe the bug
Running
~/.composer/vendor/bin/phpcs -p . --standard=PHPCompatibility --runtime-set testVersion 8.5on my codebase.I get the error ""$this" can no longer be unset since PHP 7.1.", but this is not what is happening in the code, see the offending line below.
Code sample
To reproduce
Steps to reproduce the behavior:
Expected behavior
Not being shown this error, $this is not being unset on this line, it is used as an argument to a function.
Versions (please complete the following information)
Additional context
Add any other context about the problem here.
Please confirm:
masterbranch of PHP_CodeSniffer.