userRepo->findByEmail($emailVo) !== null) { return; } $now = new DateTimeImmutable('now', new DateTimeZone('UTC')); $created = $this->userRepo->create(new CreateUserDto( email: $emailVo, displayName: $displayName, passwordHash: $this->hasher->hash($password), isAdmin: false, emailConfirmedAt: $now, )); $this->userRepo->update(new User( id: $created->getId(), email: $created->getEmail(), displayName: $created->getDisplayName(), passwordHash: $created->getPasswordHash(), isAdmin: true, emailConfirmedAt: $now, )); } }