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
I can confirm this is reproducible with the current master branch (commit dba1cc1)
The output when running on the file using the config is:
FILE: reproductions/439.php
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
10 | ERROR | The use of function join() is forbidden; use implode() instead
-----------------------------------------------------------------------------
Time: 47ms; Memory: 4MB
Debugging the violating token shows the information as shown below. Which doesn't seem to contain any information about the function namespace. Perhaps that is where the issue lies as adjusting the code the use the full qualified function name resolves the false positive. Should we perhaps look at the uses/imports and see if there is one that matches the function name. Also one last remark is that when using \join() (the native PHP versie with the root namespace of slash) it is correctly detected.
Describe the bug
This sniff incorrectly reports an error while using in my case
\Psl\Str\join
function and reports forbidden use of the native PHP functionCode sample
src/a.php
phpcs.xml
Expected behavior
No errors
Versions (please complete the following information)
Please confirm:
master
branch of PHP_CodeSniffer.The text was updated successfully, but these errors were encountered: