/
EventDispatcherInterface.php
47 lines (42 loc) · 1.13 KB
/
EventDispatcherInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace JMS\SerializerBundle\Serializer\EventDispatcher;
interface EventDispatcherInterface
{
/**
* Returns whether there are listeners.
*
* @param string $eventName
* @param string $class
* @param string $format
*
* @return boolean
*/
public function hasListeners($eventName, $class, $format);
/**
* Dispatches an event.
*
* The listeners/subscribers are called in the same order in which they
* were added to the dispatcher.
*
* @param string $eventName
* @param string $class
* @param string $format
* @param Event $event
*/
public function dispatch($eventName, $class, $format, Event $event);
/**
* Adds a listener.
*
* @param string $eventName
* @param callable $callable
* @param string|null $class
* @param string|null $format
*/
public function addListener($eventName, $callable, $class = null, $format = null);
/**
* Adds a subscribers.
*
* @param EventSubscriberInterface $subscriber
*/
public function addSubscriber(EventSubscriberInterface $subscriber);
}