src/Leevel/Event/EventProvider.php
public function bootstrap(IDispatch $dispatch): void
    {
        foreach ($this->get() as $event => $listeners) {
            foreach ($listeners as $key => $item) {
                if (is_int($item)) {
                    $dispatch->register($event, $key, $item);
                } else {
                    $dispatch->register($event, $item);
                }
            }
        }
    }
public function bootstrap(IDispatch $dispatch): void
    {
        foreach ($this->get() as $event => $listeners) {
            foreach ($listeners as $key => $item) {
                if (is_int($item)) {
                    $dispatch->register($event, $key, $item);
                } else {
                    $dispatch->register($event, $item);
                }
            }
        }
    }
注册事件监听器.

@param \Leevel\Event\IDispatch $dispatch