*/ class AddEventLogHandler implements HandlerInterface { public function __construct( private EventLogRepository $repository, ) {} public function handle(CommandInterface $command): ResultInterface { $eventLog = $this->repository->insert( user: $command->user, type: $command->type, message: $command->message, context: $command->context ); return new AddEventLogResult($eventLog); } }