*/ interface phpbb_event_dispatcher_interface { /** * Dispatches an event to all registered listeners. * * @param string $event_name The name of the event to dispatch. The name of * the event is the name of the method that is * invoked on listeners. * @param Event $event The event to pass to the event handlers/listeners. * If not supplied, an empty Event instance is created. * * @api */ function dispatch($event_name, phpbb_event $event = null); /** * Adds an event listener that listens on the specified events. * * @param string $event_name The event to listen on * @param callable $listener The listener * @param integer $priority The higher this value, the earlier an event * listener will be triggered in the chain (defaults to 0) * * @api */ function add_listener($event_name, $listener, $priority = 0); /** * Adds an event subscriber. The subscriber is asked for all the events he is * interested in and added as a listener for these events. * * @param EventSubscriberInterface $subscriber The subscriber. * * @api */ function add_subscriber(phpbb_event_subscriber_interface $subscriber); /** * Removes an event listener from the specified events. * * @param string|array $event_name The event(s) to remove a listener from. * @param object $listener The listener object to remove. */ function remove_listener($event_name, $listener); /** * Removes an event subscriber. * * @param EventSubscriberInterface $subscriber The subscriber. */ function remove_subscriber(phpbb_event_subscriber_interface $subscriber); /** * Gets the listeners of a specific event or all listeners. * * @param string $event_name The name of the event. * * @return array The event listeners for the specified event, or all event * listeners by event name. */ function get_listeners($event_name = null); /** * Checks whether an event has any registered listeners. * * @param string $event_name The name of the event. * * @return Boolean TRUE if the specified event has any listeners, FALSE * otherwise. */ function has_listeners($event_name = null); }