Refactor peer flag removal logic
This commit is contained in:
parent
8e1f6351e2
commit
e328a8c5e0
2 changed files with 17 additions and 10 deletions
|
@ -104,6 +104,15 @@ class RegisteredPeerRecord implements SerializableInterface
|
|||
return in_array($flag, $this->flags, true);
|
||||
}
|
||||
|
||||
public function removeFlag(PeerFlags $flag): void
|
||||
{
|
||||
$key = array_search($flag, $this->flags, true);
|
||||
if($key !== false)
|
||||
{
|
||||
unset($this->flags[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the current instance is enabled.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue