Open Journal Systems  3.3.0
AbstractHasDispatcher.php
1 <?php
2 
3 namespace Guzzle\Common;
4 
8 
13 {
15  protected $eventDispatcher;
16 
17  public static function getAllEvents()
18  {
19  return array();
20  }
21 
23  {
24  $this->eventDispatcher = $eventDispatcher;
25 
26  return $this;
27  }
28 
29  public function getEventDispatcher()
30  {
31  if (!$this->eventDispatcher) {
32  $this->eventDispatcher = new EventDispatcher();
33  }
34 
36  }
37 
38  public function dispatch($eventName, array $context = array())
39  {
40  return $this->getEventDispatcher()->dispatch($eventName, new Event($context));
41  }
42 
43  public function addSubscriber(EventSubscriberInterface $subscriber)
44  {
45  $this->getEventDispatcher()->addSubscriber($subscriber);
46 
47  return $this;
48  }
49 }
Guzzle\Common\AbstractHasDispatcher\addSubscriber
addSubscriber(EventSubscriberInterface $subscriber)
Definition: AbstractHasDispatcher.php:46
Guzzle\Common\AbstractHasDispatcher\$eventDispatcher
$eventDispatcher
Definition: AbstractHasDispatcher.php:18
Symfony\Component\EventDispatcher\EventSubscriberInterface
Definition: lib/vendor/symfony/event-dispatcher/EventSubscriberInterface.php:25
Guzzle\Common\AbstractHasDispatcher\setEventDispatcher
setEventDispatcher(EventDispatcherInterface $eventDispatcher)
Definition: AbstractHasDispatcher.php:25
Guzzle\Common\HasDispatcherInterface
Definition: HasDispatcherInterface.php:11
Guzzle\Common\Event
Definition: lib/vendor/guzzle/guzzle/src/Guzzle/Common/Event.php:10
Guzzle\Common\AbstractHasDispatcher\getEventDispatcher
getEventDispatcher()
Definition: AbstractHasDispatcher.php:32
Symfony\Component\EventDispatcher\EventDispatcherInterface
Definition: lib/vendor/symfony/event-dispatcher/EventDispatcherInterface.php:21
Guzzle\Common\AbstractHasDispatcher\dispatch
dispatch($eventName, array $context=array())
Definition: AbstractHasDispatcher.php:41
Guzzle\Common\AbstractHasDispatcher
Definition: AbstractHasDispatcher.php:12
Symfony\Component\EventDispatcher\EventDispatcher
Definition: lib/vendor/symfony/event-dispatcher/EventDispatcher.php:28
Guzzle\Common
Definition: AbstractHasDispatcher.php:3
Guzzle\Common\AbstractHasDispatcher\getAllEvents
static getAllEvents()
Definition: AbstractHasDispatcher.php:20