key, $cmd->value, ); // Add the option to the repository $this->repo->add($option); // Dispatch the option created event $event = new OptionCreatedEvent($option); $this->dispatcher->dispatch($event); return $option; } }