Commit 170fb52f authored by Bas de Nooijer's avatar Bas de Nooijer

Make sure an eventhandler instance is always available

parent ac46a00b
...@@ -220,6 +220,9 @@ class Client extends Configurable ...@@ -220,6 +220,9 @@ class Client extends Configurable
*/ */
protected function init() protected function init()
{ {
//@todo use injection
$this->eventDispatcher = new EventDispatcher();
foreach ($this->options as $name => $value) { foreach ($this->options as $name => $value) {
switch ($name) { switch ($name) {
case 'endpoint': case 'endpoint':
...@@ -568,10 +571,6 @@ class Client extends Configurable ...@@ -568,10 +571,6 @@ class Client extends Configurable
*/ */
public function getEventDispatcher() public function getEventDispatcher()
{ {
if (!$this->eventDispatcher) {
$this->eventDispatcher = new EventDispatcher();
}
return $this->eventDispatcher; return $this->eventDispatcher;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment