mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Use null coalesce in BanList->addBan()
This commit is contained in:
parent
a982344b96
commit
b548c4fdbe
@ -101,9 +101,9 @@ class BanList{
|
||||
*/
|
||||
public function addBan(string $target, string $reason = null, \DateTime $expires = null, string $source = null) : BanEntry{
|
||||
$entry = new BanEntry($target);
|
||||
$entry->setSource($source != null ? $source : $entry->getSource());
|
||||
$entry->setSource($source ?? $entry->getSource());
|
||||
$entry->setExpires($expires);
|
||||
$entry->setReason($reason != null ? $reason : $entry->getReason());
|
||||
$entry->setReason($reason ?? $entry->getReason());
|
||||
|
||||
$this->list[$entry->getName()] = $entry;
|
||||
$this->save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user