code: 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);
      }
docs: Set the event prototype.
  
  Only instances of DependencyResultEvent are allowed.
  
  @param EventInterface $prototype
  @throws \InvalidArgumentException