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
*/
protected function init()
{
//@todo use injection
$this->eventDispatcher = new EventDispatcher();
foreach ($this->options as $name => $value) {
switch ($name) {
case 'endpoint':
......@@ -568,10 +571,6 @@ class Client extends Configurable
*/
public function getEventDispatcher()
{
if (!$this->eventDispatcher) {
$this->eventDispatcher = new 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