protected function triggerListeners(EventInterface $event, callable $callback = null)
    {
        if (!$event instanceof DependencyResultEvent) {
            throw new \InvalidArgumentException('This event manager only accepts events of the type ' . DependencyResultEvent::class);
        }

        $results = parent::triggerListeners($event, $callback);

        $dependencies = $event->getDependencyResultCollection();

        foreach ($results as $result) {
            if (null !== $result) {
                try {
                    $dependencies->add($result);
                }
                /* silently ignore all invalid results */
                catch (\UnexpectedValueException $e) {
                } catch (\InvalidArgumentException $e) {
                }
            }
        }

        return $results;
    }