The expression $siteId of type null|integer is loosely compared to true; this is ambiguous if the integer can be zero. You might want to explicitly use !== null instead.
In PHP, under loose comparison (like ==, or !=, or switch conditions),
values of different types might be equal.
For integer values, zero is a special case, in particular the following
results might be unexpected:
0==false// true0==null// true123==false// false123==null// false// It is often better to use strict comparison0===false// false0===null// false
Loading history...
62
$query->siteId($siteId);
63
}
64
65
if (!$record = $query->one()) {
66
return true;
67
}
68
69
return $this->runInternal($record);
70
}
71
72
/**
73
* @param Association $record
74
* @return bool
75
* @throws \Throwable
76
* @throws \yii\db\StaleObjectException
77
*/
78
protected function performAction(Association $record): bool
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: