public function addListener($event, $listener)
    {
        if (!is_callable($listener)) {
            throw new InvalidArgumentException('Unable to add a listener on event "' . $event . '": given listener is not callable');
        }

        if (!array_key_exists($event, $this->listeners)) {
            $this->listeners[$event] = [];
        }

        $this->listeners[$event][spl_object_hash($listener)] = $listener;

        return $this;
    }