vendor/symfony/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * This file is part of the Symfony package.
       
     5  *
       
     6  * (c) Fabien Potencier <fabien@symfony.com>
       
     7  *
       
     8  * For the full copyright and license information, please view the LICENSE
       
     9  * file that was distributed with this source code.
       
    10  */
       
    11 
       
    12 namespace Symfony\Component\EventDispatcher;
       
    13 
       
    14 /**
       
    15  * An EventSubscriber knows himself what events he is interested in.
       
    16  * If an EventSubscriber is added to an EventDispatcherInterface, the manager invokes
       
    17  * {@link getSubscribedEvents} and registers the subscriber as a listener for all
       
    18  * returned events.
       
    19  *
       
    20  * @link    www.doctrine-project.org
       
    21  * @since   2.0
       
    22  * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
       
    23  * @author  Jonathan Wage <jonwage@gmail.com>
       
    24  * @author  Roman Borschel <roman@code-factory.org>
       
    25  * @author  Bernhard Schussek <bschussek@gmail.com>
       
    26  *
       
    27  * @api
       
    28  */
       
    29 interface EventSubscriberInterface
       
    30 {
       
    31     /**
       
    32      * Returns an array of event names this subscriber wants to listen to.
       
    33      *
       
    34      * The array keys are event names and the value can be:
       
    35      *
       
    36      *  * The method name to call (priority defaults to 0)
       
    37      *  * An array composed of the method name to call and the priority
       
    38      *
       
    39      * For instance:
       
    40      *
       
    41      *  * array('eventName' => 'methodName')
       
    42      *  * array('eventName' => array('methodName', $priority))
       
    43      *
       
    44      * @return array The event names to listen to
       
    45      *
       
    46      * @api
       
    47      */
       
    48     static function getSubscribedEvents();
       
    49 }