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
Sniff SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod detects unused private method, but it is using as callable with array synax (e.g. [$this, 'methodName']).
Error:
FILE: /home/vagrant/projects/secret-project/src/PrivateMethodDemo.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
23 | ERROR | Class PrivateMethodDemo contains unused private method
| | privateMethod().
| | (SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod)
Packages versions
squizlabs/php_codesniffer version: 3.5.6
slevomat/coding-standard version 6.4.0
Hi!
Sniff
SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod
detects unused private method, but it is using ascallable
with array synax (e.g.[$this, 'methodName']
).Error:
Packages versions
squizlabs/php_codesniffer version: 3.5.6
slevomat/coding-standard version 6.4.0
Code example:
P.S.: PhpStorm can detect that the private method is used.
![image](https://user-images.githubusercontent.com/1114387/94725583-ac769e80-0364-11eb-8170-c685d0b73be8.png)
The text was updated successfully, but these errors were encountered: