Example #1
0
 public function regenerateAPIKey(int $accountId) : string
 {
     $account = $this->getById($accountId);
     do {
         $account->regenerateAPIKey();
     } while ($this->checkAPIKeyCollision($account->getAPIKey()));
     $this->accountRepository->saveAccount($account);
     return $account->getAPIKey();
 }