Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 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 self
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
     * @return Event Returns the created event object
43
     */
44
    public function dispatch($eventName, array $context = array());
45
 
46
    /**
47
     * Add an event subscriber to the dispatcher
48
     *
49
     * @param EventSubscriberInterface $subscriber Event subscriber
50
     *
51
     * @return self
52
     */
53
    public function addSubscriber(EventSubscriberInterface $subscriber);
54
}