1: <?php
2:
3: namespace Guzzle\Common;
4:
5: use Symfony\Component\EventDispatcher\EventDispatcherInterface;
6: use Symfony\Component\EventDispatcher\EventSubscriberInterface;
7:
8: /**
9: * Holds an event dispatcher
10: */
11: interface HasDispatcherInterface
12: {
13: /**
14: * Get a list of all of the events emitted from the class
15: *
16: * @return array
17: */
18: public static function getAllEvents();
19:
20: /**
21: * Set the EventDispatcher of the request
22: *
23: * @param EventDispatcherInterface $eventDispatcher
24: *
25: * @return HasDispatcherInterface
26: */
27: public function setEventDispatcher(EventDispatcherInterface $eventDispatcher);
28:
29: /**
30: * Get the EventDispatcher of the request
31: *
32: * @return EventDispatcherInterface
33: */
34: public function getEventDispatcher();
35:
36: /**
37: * Helper to dispatch Guzzle events and set the event name on the event
38: *
39: * @param string $eventName Name of the event to dispatch
40: * @param array $context Context of the event
41: */
42: public function dispatch($eventName, array $context = array());
43:
44: /**
45: * Add an event subscriber to the dispatcher
46: *
47: * @param EventSubscriberInterface $subscriber Event subscriber
48: *
49: * @return AbstractHasDispatcher
50: */
51: public function addSubscriber(EventSubscriberInterface $subscriber);
52: }
53: