Avoid use of assignments bare inside statements

Either use them in a subroutine call or put parentheses around the assignment.
This commit is contained in:
Alexei Sorokin
2020-09-08 12:42:51 +03:00
parent d0f96a7023
commit adc689cb15
15 changed files with 934 additions and 791 deletions

View File

@@ -964,7 +964,10 @@ class Ostatus_profile extends Managed_DataObject
$best = false;
// Take the exact-size avatar, or the largest avatar, or the first avatar if all sizeless
foreach ($object->avatarLinks as $avatar) {
if ($avatar->width == AVATAR_PROFILE_SIZE && $avatar->height = AVATAR_PROFILE_SIZE) {
if (
$avatar->width === AVATAR_PROFILE_SIZE
&& $avatar->height === AVATAR_PROFILE_SIZE
) {
// Exact match!
$best = $avatar;
break;