use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Event; // create the event dispatcher $dispatcher = new EventDispatcher(); // bind a listener to the event $dispatcher->addListener('my.event', function (Event $event) { // do something }); // get listeners for the event $listeners = $dispatcher->getListeners('my.event'); // $listeners now contains an array of closures bound to the "my.event" eventIn this example, we create an event dispatcher instance and bind a closure to a custom event. We then use the getListeners method to retrieve all listeners bound to this event. The package library is Symfony\Component\EventDispatcher.