src/DI/EventDispatcherExtension.php
private function doBeforeCompile(): void
	{
		$builder = $this->getContainerBuilder();
		$dispatcher = $builder->getDefinition($this->prefix('dispatcher'));

		$subscribers = $builder->findByType(EventSubscriberInterface::class);
		foreach ($subscribers as $name => $subscriber) {
			$dispatcher->addSetup('addSubscriber', [$subscriber]);
		}
	}
private function doBeforeCompile(): void
	{
		$builder = $this->getContainerBuilder();
		$dispatcher = $builder->getDefinition($this->prefix('dispatcher'));

		$subscribers = $builder->findByType(EventSubscriberInterface::class);
		foreach ($subscribers as $name => $subscriber) {
			$dispatcher->addSetup('addSubscriber', [$subscriber]);
		}
	}
private function doBeforeCompile ( ) : void { $ builder = $ this -> getContainerBuilder ( ) ; $ dispatcher = $ builder -> getDefinition ( $ this -> prefix ( 'dispatcher' ) ) ; $ subscribers = $ builder -> findByType ( EventSubscriberInterface :: class ) ; foreach ( $ subscribers as $ name => $ subscriber ) { $ dispatcher -> addSetup ( 'addSubscriber' , [ $ subscriber ] ) ; } }
Collect listeners and subscribers
Collect listeners and subscribers