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
If a method parameter is used in the method as a reference (AKA alias, i.e., prefixing with an ampersand), Psalm marks that parameter as unused. Removing the ampersand removes the error.
Psalm output (using commit 08afc45):
INFO: UnusedClass - 3:13 - Class MyClass is never used
INFO: UnusedParam - 7:43 - Param #1 is never referenced in this method
Object are always passed by reference. $this->config = &$config; is the exact same as $this->config = $config;
It saying the param is unused is a bug, but you can avoid it by not having redundant code.
Here is an example of this bug with non-redundant code: https://psalm.dev/r/578763b870
If a method parameter is used in the method as a reference (AKA alias, i.e., prefixing with an ampersand), Psalm marks that parameter as unused. Removing the ampersand removes the error.
https://psalm.dev/r/b46281057c
(Apologies if this is a duplicate, I searched several times and couldn't find this reported previously.)
The text was updated successfully, but these errors were encountered: