initializeSubscribers example


    public function __construct(ContainerInterface $container, array $listeners = [])
    {
        $this->container = $container;
        $this->listeners = $listeners;
    }

    public function dispatchEvent($eventName, EventArgs $eventArgs = null): void
    {
        if (!$this->initializedSubscribers) {
            $this->initializeSubscribers();
        }
        if (!isset($this->listeners[$eventName])) {
            return;
        }

        $eventArgs ??= EventArgs::getEmptyInstance();

        if (!isset($this->initialized[$eventName])) {
            $this->initializeListeners($eventName);
        }

        
Home | Imprint | This part of the site doesn't use cookies.