Register event listeners.

@param  DispatcherContract  $events
@return void
547294
public function registerListeners(DispatcherContract $events)
    {
        foreach ($this->listen as $event => $listeners) {
            foreach ($listeners as $listener) {
                $events->listen($event, $listener);
            }
        }
    }
191529
public function registerSubscriptions(EventDispatcher $dispatcher)
    {
        if ($this->registered) {
            throw new \RuntimeException('Cannot register debug toolbar subscriptions when already registered.');
        }

        foreach ($this->toolbar->getExtensions() as $extension) {
            if ( ! $extension instanceof EventSubscriberInterface) {
                continue;
            }

            $dispatcher->addSubscriber($extension);
        }

        $this->registered = true;
    }
403877
protected function registerListeners()
    {
        Event::listen(RouteMatched::class, BlockLoad::class);
        Event::listen(GzeroRouteMatched::class, BlockLoad::class);
        Event::listen('block.*', BlockCacheClear::class);
    }
639465
public function addListener(string $eventName, $listener) : void
    {
        $this->dispatcher->addListener($eventName, $listener);
    }
1142504
public function subscribe($events)
    {
        $events->listen(
            [
                PreProcessApiEvent::class,
                PostProcessApiEvent::class,
            ],
            static::class . '@handleApiEvent'
        );
        $events->listen(
            [
                ApiEvent::class,
                ServiceEvent::class,
            ],
            static::class . '@handleServiceEvent'
        );
        $events->listen(
            [
                EventScriptModifiedEvent::class,
                EventScriptDeletedEvent::class,
            ],
            static::class . '@handleEventScriptEvent'
        );
    }
35072
public function attach(ActionEventDispatcher $events)
    {
        $this->trackHandler($events->attachListener(MessageDispatch::INITIALIZE, [$this, 'onInitializeMessageDispatch']));
        $this->trackHandler($events->attachListener(MessageDispatch::FINALIZE, [$this, 'onFinalizeMessageDispatch']));
    }
535657
public function dispatch(array $events)
    {
        foreach ($events as $event) {
            $eventName = $this->getEventName($event);

            $this->app->fireEvent($eventName, $event);
            $this->app->logEvent($eventName .' was fired.');
        }
    }
814300
public function subscribe(Dispatcher $events)
    {
        $events->listen(Deserializing::class, [$this, 'addUploadMethods']);
        $events->listen(Deserializing::class, [$this, 'addTemplates']);
        $events->listen(Serializing::class, [$this, 'prepareApiAttributes']);
    }
1020732
public function registerEventListeners()
    {
        if ( $this->loadGlobalEvents )
        {
            $listeners = eZINI::instance()->variable( 'Event', 'Listeners' );
            foreach ( $listeners as $listener )
            {
                // $listener may be empty if some override logic has been involved
                if ( $listener == "" )
                {
                    continue;
                }

                // format from ini is seperated by @
                list( $event, $callback ) = explode( '@', $listener );
                $this->attach( $event, $callback );
            }
        }
    }
444963
protected function registerListener($event, $listener, $priority)
    {
        if (!is_callable($listener)) {
            throw new DispatcherException(sprintf('Invalid event listener. Only callables or ListenerInterface instances can be registered, got "%s"', gettype($listener)));
        }

        if (!isset($this->events[$event])) {
            $this->events[$event] = [];
        }

        if ($priority === null) {
            $this->events[$event][] = $listener;

            return;
        }

        array_splice($this->events[$event], (int) $priority, 0, [$listener]);
    }
1340925
public function dispatch(Event $event) {

		$this->lastEvent = $event;
		$eventName = $event->getName();

		if (isset($this->registry[$eventName])) {

			foreach ($this->getSortedRegistry($eventName) as $listener) {
				call_user_func($listener, $event);
			}
			
		}

	}
41644
public function setEvents(array $events)
	{
		if ($events) {
			$this->ensureEvents();
			
			foreach ($events as $name => $handler) {
				$this->on($name, $handler);
			}
		}
	}
837888
public function handle(Dispatcher $events)
    {
        $model = $this->argument('model');
        $this->service = app(RatingServiceContract::class);

        if (empty($model)) {
            $this->recountRatingOfAllModelTypes();
        } else {
            $this->recountRatingOfModelType($model);
        }
    }
1315792
public function bind(EventDispatcherInterface $dispatcher, $eventName)
    {
        if (isset($this->events[$eventName])) {
            return;
        }

        $dispatcher->addListener($eventName, $this->getListener(), $this->priority);
        $this->events[$eventName] = true;
    }
184033
public function subscribe(Dispatcher $events)
    {
        $events->listen(
            DiskUsageHealthy::class,
            static::class.'@whenDiskUsageHealthy'
        );

        $events->listen(
            DiskUsageAlarm::class,
            static::class.'@whenDiskUsageAlarm'
        );

        $events->listen(
            HttpPingUp::class,
            static::class.'@whenHttpPingUp'
        );

        $events->listen(
            HttpPingDown::class,
            static::class.'@whenHttpPingDown'
        );

        $events->listen(
            SSLCertificateValid::class,
            static::class.'@whenSSLCertificateValid'
        );

        $events->listen(
            SSLCertificateInvalid::class,
            static::class.'@whenSSLCertificateInvalid'
        );

        $events->listen(
            SSLCertificateExpiring::class,
            static::class.'@whenSSLCertificateExpiring'
        );
    }
1137222
protected function registerListeners($service)
    {
        $serviceMetadata = $this->serviceMetadataFactory->getMetadataFor(get_class($service));

        foreach ($serviceMetadata->getAllListeners() as $event => $listeners) {
            foreach ($listeners as $listener) {
                $this->eventManager->addListener($event, array($service, $listener));
            }
        }
    }
1196585
static private function bindEventListenersEvents()
    {
    	if (self::$_eventListeners && !self::$_elInstances) {
    		foreach (self::$_eventListeners as $class => $listeners) {
    			if ($listeners) foreach ($listeners as $listener) {
    				
    				$listener = self::getListener($listener);
    				
    				$events = $listener->events();
    				
    				if ($events) foreach ($events as $name => $handler) {
    					Event::on($class, $name, is_string($handler) ? [$listener, $handler] : $handler);
    				}
    			}
    		}
    	}
    }