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
Create a file called test.php with the code sample above...
Run phpcs test.php ...
See error message displayed
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
4 | ERROR | New objects must be assigned to a variable
5 | ERROR | New objects must be assigned to a variable
Expected behavior
Error Squiz.Objects.ObjectInstantiation.NotAssigned is not reported for any of the lines.
Versions (please complete the following information):
OS: Ubuntu Linux 20.10
PHP: 8.0.5
PHPCS: 3.6.0
Standard: custom
The text was updated successfully, but these errors were encountered:
gsherwood
changed the title
Squiz.Objects.ObjectInstantiation: null coalesce operators are nor recognized as assignment
Squiz.Objects.ObjectInstantiation: null coalesce operators are not recognized as assignment
Aug 12, 2021
Describe the bug
Sniff
Squiz.Objects.ObjectInstantiation
does not recognizes??
and??=
operators as assignment.Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
Error
Squiz.Objects.ObjectInstantiation.NotAssigned
is not reported for any of the lines.Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: