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

Breadcrumb

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

function EventSubscriberInterface::getSubscribedEvents

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

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 value

array<string, string|array{0: string, 1?: int}|array<array{0: string, 1?: int}>> The event names to listen to

7 methods override EventSubscriberInterface::getSubscribedEvents()
MessagePlugin::getSubscribedEvents in composer/Plugin/ProjectMessage/MessagePlugin.php
Returns an array of event names this subscriber wants to listen to.
Plugin::getSubscribedEvents in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php
Returns an array of event names this subscriber wants to listen to.
Plugin::getSubscribedEvents in vendor/phpstan/extension-installer/src/Plugin.php
*
Plugin::getSubscribedEvents in vendor/php-http/discovery/src/Composer/Plugin.php
Returns an array of event names this subscriber wants to listen to.
Plugin::getSubscribedEvents in vendor/tbachert/spi/src/Composer/Plugin.php
Returns an array of event names this subscriber wants to listen to.

... See full list

File

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

Class

EventSubscriberInterface
An EventSubscriber knows which events it is interested in.

Namespace

Composer\EventDispatcher

Code

public static function getSubscribedEvents();

API Navigation

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