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 you want to run psalm in the html/ directory above, it will take ~40 minutes. By trying to reduce the code I came to (https://psalm.dev/r/0a1e623634):
which highlight the same issue. But I do not know if this is the same root cause. Note that the issue disappears if I add the following above:
class User {
publicstaticfunctionlookup_id($userid) {}
}
I searched if this issue was already reported but it looks like no. There are other issues about UnusedParam false-positive, but they seem to be about other cases.
The text was updated successfully, but these errors were encountered:
<?php// class User {// public static function lookup_id($userid) {}// }functionpm_form_page($replyto, $userid) {
if ($replyto) {
$userid = 'a';
User::lookup_id($userid);
} elseif ($userid) {
$user = User::lookup_id($userid);
}
}
Psalm output (using commit a9b5291):
ERROR: UndefinedClass - 10:9 - Class, interface or enum named User does not exist
INFO: MissingParamType - 7:23 - Parameter $replyto has no provided type
INFO: MissingParamType - 7:33 - Parameter $userid has no provided type
INFO: UnusedParam - 7:33 - Param userid is never referenced in this method
INFO: MissingReturnType - 7:10 - Method pm_form_page does not have a return type, expecting void
On the following code, psalm reports an UnusedParam for
$userid
and$error
:https://github.com/BOINC/boinc/blob/275a2a42b7004e84cb4245161211ce0a99bec7cf/html/inc/pm.inc#L113-L209
I do not really understand why, because the
$userid
param is used on:https://github.com/BOINC/boinc/blob/275a2a42b7004e84cb4245161211ce0a99bec7cf/html/inc/pm.inc#L145
If you want to run psalm in the
html/
directory above, it will take ~40 minutes. By trying to reduce the code I came to (https://psalm.dev/r/0a1e623634):which highlight the same issue. But I do not know if this is the same root cause. Note that the issue disappears if I add the following above:
I searched if this issue was already reported but it looks like no. There are other issues about UnusedParam false-positive, but they seem to be about other cases.
The text was updated successfully, but these errors were encountered: