src/Service/EntityEraser/EntityEraserEvents.php
public function setEventPrototype(EventInterface $prototype)
    {
        if (!$prototype instanceof DependencyResultEvent) {
            throw new \InvalidArgumentException('This event manager only accepts events of the type ' . DependencyResultEvent::class);
        }

        parent::setEventPrototype($prototype);
    }
public function setEventPrototype(EventInterface $prototype)
    {
        if (!$prototype instanceof DependencyResultEvent) {
            throw new \InvalidArgumentException('This event manager only accepts events of the type ' . DependencyResultEvent::class);
        }

        parent::setEventPrototype($prototype);
    }
Set the event prototype.

Only instances of DependencyResultEvent are allowed.

@param EventInterface $prototype
@throws \InvalidArgumentException