public function __invoke()
 {
     $deleteScript = $this->deleteAccountScript;
     return array_map(function (Account $account) use($deleteScript) {
         return $deleteScript($account);
     }, $this->accountRepository->getPendingDeleteAccounts(self::DAYS_TO_ACCEPT_REQUEST));
 }
 public function __invoke(Account $account)
 {
     $accountId = $account->getId();
     $accountEmail = $account->getEmail();
     $this->accountRepository->deleteAccount($account);
     return ['id' => $accountId, 'email' => $accountEmail, 'entity' => $account];
 }
 public function signInWithStrategies(array $strategies)
 {
     /** @var Strategy[] $strategies */
     foreach ($strategies as $strategy) {
         if ($strategy->isAPIKeyAvailable()) {
             try {
                 $this->account = $this->accountRepository->findByAPIKey($strategy->getAPIKey());
                 return;
             } catch (AccountNotFoundException $e) {
                 throw new NotAuthenticatedException(sprintf('Invalid API Key with used strategy `%s`', get_class($strategy)));
             }
         }
     }
     throw new NotAuthenticatedException('No API Key available');
 }
Beispiel #4
0
 public function getByEmail(string $email) : Account
 {
     return $this->accountRepository->getByEmail($email);
 }