Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EventSubscriberInterface.php

interface EventSubscriberInterface

Same name in this branch
  1. 11.1.x vendor/symfony/event-dispatcher/EventSubscriberInterface.php \Symfony\Component\EventDispatcher\EventSubscriberInterface

An EventSubscriber knows which events it is interested in.

If an EventSubscriber is added to an EventDispatcher, the manager invokes {@link getSubscribedEvents} and registers the subscriber as a listener for all returned events.

@author Guilherme Blanco <guilhermeblanco@hotmail.com> @author Jonathan Wage <jonwage@gmail.com> @author Roman Borschel <roman@code-factory.org> @author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

  • interface \Composer\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of EventSubscriberInterface

All classes that implement EventSubscriberInterface

8 files declare their use of EventSubscriberInterface
MessagePlugin.php in composer/Plugin/ProjectMessage/MessagePlugin.php
Plugin.php in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php
Plugin.php in vendor/phpstan/extension-installer/src/Plugin.php
Plugin.php in vendor/php-http/discovery/src/Composer/Plugin.php
Plugin.php in vendor/tbachert/spi/src/Composer/Plugin.php

... See full list

File

vendor/composer/composer/src/Composer/EventDispatcher/EventSubscriberInterface.php, line 27

Namespace

Composer\EventDispatcher
View source
interface EventSubscriberInterface {
    
    /**
     * Returns an array of event names this subscriber wants to listen to.
     *
     * The array keys are event names and the value can be:
     *
     * * The method name to call (priority defaults to 0)
     * * An array composed of the method name to call and the priority
     * * An array of arrays composed of the method names to call and respective
     *   priorities, or 0 if unset
     *
     * For instance:
     *
     * * array('eventName' => 'methodName')
     * * array('eventName' => array('methodName', $priority))
     * * array('eventName' => array(array('methodName1', $priority), array('methodName2'))
     *
     * @return array<string, string|array{0: string, 1?: int}|array<array{0: string, 1?: int}>> The event names to listen to
     */
    public static function getSubscribedEvents();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
EventSubscriberInterface::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 7

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal