PHPStan level 3 #1603
1 changed files with 1 additions and 1 deletions
Fix error in notifyall addon
commit
dda6710b10
|
@ -50,7 +50,7 @@ function notifyall_post()
|
||||||
|
|
||||||
$recipients = DBA::p("SELECT DISTINCT `email` FROM `user`" . DBA::buildCondition($condition), $condition);
|
$recipients = DBA::p("SELECT DISTINCT `email` FROM `user`" . DBA::buildCondition($condition), $condition);
|
||||||
|
|
||||||
if (! $recipients) {
|
if (! $recipients || !is_iterable($recipients)) {
|
||||||
Art4 marked this conversation as resolved
Outdated
|
|||||||
DI::sysmsg()->addNotice(DI::l10n()->t('No recipients found.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('No recipients found.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue
Instead of checking for this,
$recipients
should be assigned the result ofDBA::toArray(DBA:p(...))
in order for the laterforeach()
to be valid. Normally, theDBA::p
output requires the use ofDBA::fetch()
in a loop.Sure, the
PDOStatement
is iterable, but themysqli
-produced result resource probably isn't.Done, thank you.