PluginProbe
ManageWP Worker / 4.9.34
ManageWP Worker v4.9.34
4.9.38 4.9.37 4.9.36 4.9.35 4.9.34 3.8.7 3.8.8 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.22 3.9.23 3.9.24 All 73 releases
worker / src / Symfony / EventDispatcher / EventDispatcherInterface.php

EventDispatcherInterface.php in ManageWP Worker 4.9.34, at src/Symfony/EventDispatcher/EventDispatcherInterface.php

99 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
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 /**
13 * The EventDispatcherInterface is the central point of Symfony's event listener system.
14 * Listeners are registered on the manager and events are dispatched through the
15 * manager.
16 *
17 * @author Bernhard Schussek <[email protected]>
18 *
19 * @api
20 */
21 interface Symfony_EventDispatcher_EventDispatcherInterface
22 {
23 /**
24 * Dispatches an event to all registered listeners.
25 *
26 * @param string $eventName The name of the event to dispatch. The name of
27 * the event is the name of the method that is
28 * invoked on listeners.
29 * @param Symfony_EventDispatcher_Event $event The event to pass to the event handlers/listeners.
30 * If not supplied, an empty Event instance is created.
31 *
32 * @return Symfony_EventDispatcher_Event
33 *
34 * @api
35 *
36 * Note: Type hint removed from $event parameter to fix PHP 8.4+ deprecation warning
37 * about implicitly nullable parameters while maintaining backward compatibility with PHP 5.5+.
38 * The nullable type syntax (?Symfony_EventDispatcher_Event) is not supported in PHP 5.5-7.0.
39 */
40 public function dispatch($eventName, $event = null);
41
42 /**
43 * Adds an event listener that listens on the specified events.
44 *
45 * @param string $eventName The event to listen on
46 * @param callable $listener The listener
47 * @param int $priority The higher this value, the earlier an event
48 * listener will be triggered in the chain (defaults to 0)
49 *
50 * @api
51 */
52 public function addListener($eventName, $listener, $priority = 0);
53
54 /**
55 * Adds an event subscriber.
56 *
57 * The subscriber is asked for all the events he is
58 * interested in and added as a listener for these events.
59 *
60 * @param Symfony_EventDispatcher_EventSubscriberInterface $subscriber The subscriber.
61 *
62 * @api
63 */
64 public function addSubscriber(Symfony_EventDispatcher_EventSubscriberInterface $subscriber);
65
66 /**
67 * Removes an event listener from the specified events.
68 *
69 * @param string $eventName The event to remove a listener from
70 * @param callable $listener The listener to remove
71 */
72 public function removeListener($eventName, $listener);
73
74 /**
75 * Removes an event subscriber.
76 *
77 * @param Symfony_EventDispatcher_EventSubscriberInterface $subscriber The subscriber
78 */
79 public function removeSubscriber(Symfony_EventDispatcher_EventSubscriberInterface $subscriber);
80
81 /**
82 * Gets the listeners of a specific event or all listeners.
83 *
84 * @param string $eventName The name of the event
85 *
86 * @return array The event listeners for the specified event, or all event listeners by event name
87 */
88 public function getListeners($eventName = null);
89
90 /**
91 * Checks whether an event has any registered listeners.
92 *
93 * @param string $eventName The name of the event
94 *
95 * @return bool true if the specified event has any listeners, false otherwise
96 */
97 public function hasListeners($eventName = null);
98 }
99