Documentation

EventScannerPass
in package
implements CompilerPassInterface

Scan for services that have the tag 'event_subscriber'.

Specifically, any class tagged as event_subscriber will be scanned for event listeners. The subscriber should implement a relevant interface, such as:

  • HookInterface: The class uses hook_*() methods.
  • EventSubscriberInterface: the class provides a getSubscribedEvents() method.

The list of listeners will be extracted stored as part of the container-cache.

NOTE: This is similar to Symfony's RegisterListenersPass() but differs in a few ways:

  • Works with both HookInterface and EventSubscriberInterface
  • Watches tag 'event_subscriber' (not 'kernel.event_listener' or 'kernel.event_subscriber')

Table of Contents

Interfaces

CompilerPassInterface

Methods

process()  : mixed

Methods

process()

public process(ContainerBuilder $container) : mixed
Parameters
$container : ContainerBuilder

        
On this page

Search results