simplify EventDispatcher@removeAllListeners and resetInstance

pull/722/head
fadrian06 3 days ago
parent 4cb50f66ab
commit cd3d8bb44e

@ -78,25 +78,11 @@ class EventDispatcher
)); ));
} }
/**
* Remove all listeners for a specific event.
*
* @param string $event the event name
*
* @return void
*/
public function removeAllListeners(string $event): void public function removeAllListeners(string $event): void
{ {
if (isset($this->listeners[$event]) === true) {
unset($this->listeners[$event]); unset($this->listeners[$event]);
} }
}
/**
* Remove the current singleton instance of the EventDispatcher.
*
* @return void
*/
public static function resetInstance(): void public static function resetInstance(): void
{ {
self::$instance = null; self::$instance = null;

Loading…
Cancel
Save