mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-29 14:15:47 +00:00
HandlerListManager::unregisterAll() accepts RegisteredListener
since all this function is doing is passing the object on to the HandlerList, it should accept RegisteredListener, like HandlerList::unregister().
This commit is contained in:
parent
b4c0ddd155
commit
2ad5de379f
@ -42,10 +42,10 @@ class HandlerListManager{
|
|||||||
* Unregisters all the listeners
|
* Unregisters all the listeners
|
||||||
* If a Plugin or Listener is passed, all the listeners with that object will be removed
|
* If a Plugin or Listener is passed, all the listeners with that object will be removed
|
||||||
*
|
*
|
||||||
* @param Plugin|Listener|null $object
|
* @param Plugin|Listener|RegisteredListener|null $object
|
||||||
*/
|
*/
|
||||||
public function unregisterAll($object = null) : void{
|
public function unregisterAll($object = null) : void{
|
||||||
if($object instanceof Listener or $object instanceof Plugin){
|
if($object instanceof Listener or $object instanceof Plugin or $object instanceof RegisteredListener){
|
||||||
foreach($this->allLists as $h){
|
foreach($this->allLists as $h){
|
||||||
$h->unregister($object);
|
$h->unregister($object);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user