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:
Dylan K. Taylor 2021-08-10 15:28:11 +01:00
parent b4c0ddd155
commit 2ad5de379f
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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);
} }