diff options
author | Faraz Samapoor <fsa@adlas.at> | 2023-07-02 12:01:11 +0330 |
---|---|---|
committer | Faraz Samapoor <fsa@adlas.at> | 2023-07-02 12:01:11 +0330 |
commit | 8cb078b58c4e657557436907b8b90eed6fff1153 (patch) | |
tree | 4465967da9537de982e577df334ed03f32184e78 /lib/private/Accounts | |
parent | a1acacf032faa661b241f2fa89b05a540c7dec65 (diff) | |
download | nextcloud-server-8cb078b58c4e657557436907b8b90eed6fff1153.tar.gz nextcloud-server-8cb078b58c4e657557436907b8b90eed6fff1153.zip |
Fixes testcase errors.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
Diffstat (limited to 'lib/private/Accounts')
-rw-r--r-- | lib/private/Accounts/AccountManager.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 73492b63a26..3574d1a90a0 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -85,7 +85,7 @@ class AccountManager implements IAccountManager { private string $table = 'accounts'; private string $dataTable = 'accounts_data'; - private IL10N $l10n; + private ?IL10N $l10n = null; private CappedMemoryCache $internalCache; /** @@ -120,7 +120,6 @@ class AccountManager implements IAccountManager { private ICrypto $crypto, ) { $this->internalCache = new CappedMemoryCache(); - $this->l10n = $factory->get('core'); } /** @@ -348,12 +347,10 @@ class AccountManager implements IAccountManager { } protected function searchUsersForRelatedCollection(string $property, array $values): array { - switch ($property) { - case IAccountManager::PROPERTY_EMAIL: - return array_flip($this->searchUsers(IAccountManager::COLLECTION_EMAIL, $values)); - default: - return []; - } + return match ($property) { + IAccountManager::PROPERTY_EMAIL => array_flip($this->searchUsers(IAccountManager::COLLECTION_EMAIL, $values)), + default => [], + }; } /** @@ -416,6 +413,10 @@ class AccountManager implements IAccountManager { 'link' => $link, ]); + if (!$this->l10n) { + $this->l10n = $this->factory->get('core'); + } + $emailTemplate->setSubject($this->l10n->t('%s email verification', [$this->defaults->getName()])); $emailTemplate->addHeader(); $emailTemplate->addHeading($this->l10n->t('Email verification')); |