use Symfony\Component\EventDispatcher\Event; class MyEvent extends Event { public function __construct($param1, $param2) { $this->param1 = $param1; $this->param2 = $param2; } public function getParam1() { return $this->param1; } public function getParam2() { return $this->param2; } } $dispatcher = new Symfony\Component\EventDispatcher\EventDispatcher(); $dispatcher->addListener('my.event', function (MyEvent $event) { $param1 = $event->getParam1(); $param2 = $event->getParam2(); // Do something with the parameters... }); $event = new MyEvent('hello', 'world'); $event->addParam('foo', 'bar'); $dispatcher->dispatch('my.event', $event);In the example above, we define a new `MyEvent` class that extends `Symfony\Component\EventDispatcher\Event`. We then pass two parameters to the event constructor. We add an event listener to the dispatcher that listens for the `my.event` event. When the event is triggered, the callback function receives the `MyEvent` object and retrieves the two parameters that were passed to the event constructor. Before dispatching the event, we use the `addParam` method to add a third parameter to the event object with the key `foo` and the value `bar`. The package library being used in this example is `Symfony\Component\EventDispatcher`.