1
0
mirror of https://github.com/flarum/core.git synced 2025-08-12 19:34:18 +02:00

chore: simplify if else conditions (#3843)

* chore: simplify if else conditions

* use nullsafe

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
Ngô Quốc Đạt
2023-07-27 17:31:04 +07:00
committed by GitHub
parent 76004ed844
commit 59586e63e1
5 changed files with 7 additions and 17 deletions

View File

@@ -34,11 +34,7 @@ class SaveNicknameToDatabase
// If the user sets their nickname back to the username
// set the nickname to null so that it just falls back to the username
if ($user->username === $nickname) {
$user->nickname = null;
} else {
$user->nickname = $nickname;
}
$user->nickname = $user->username === $nickname ? null : $nickname;
}
}
}