aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication/TwoFactorAuth/ProviderManager.php
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2025-01-21 22:52:12 +0100
committerGit'Fellow <12234510+solracsf@users.noreply.github.com>2025-01-22 16:59:12 +0100
commit3c208955241d2608d50eee355852bf21b7f33933 (patch)
tree6f9199322b0ee711828e657e58209d6b794e6159 /lib/private/Authentication/TwoFactorAuth/ProviderManager.php
parent250549cd031c6b62fd5728c531fed2bdc219e565 (diff)
downloadnextcloud-server-authPropertyPromotion.tar.gz
nextcloud-server-authPropertyPromotion.zip
refactor(authentication): Use constructor property promotionauthPropertyPromotion
fix: error
Diffstat (limited to 'lib/private/Authentication/TwoFactorAuth/ProviderManager.php')
-rw-r--r--lib/private/Authentication/TwoFactorAuth/ProviderManager.php25
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/ProviderManager.php b/lib/private/Authentication/TwoFactorAuth/ProviderManager.php
index 5ce4c598154..a4d0b3dc88f 100644
--- a/lib/private/Authentication/TwoFactorAuth/ProviderManager.php
+++ b/lib/private/Authentication/TwoFactorAuth/ProviderManager.php
@@ -16,17 +16,16 @@ use OCP\Authentication\TwoFactorAuth\IRegistry;
use OCP\IUser;
class ProviderManager {
- /** @var ProviderLoader */
- private $providerLoader;
- /** @var IRegistry */
- private $providerRegistry;
-
- public function __construct(ProviderLoader $providerLoader, IRegistry $providerRegistry) {
- $this->providerLoader = $providerLoader;
- $this->providerRegistry = $providerRegistry;
+ public function __construct(
+ private ProviderLoader $providerLoader,
+ private IRegistry $providerRegistry,
+ ) {
}
+ /**
+ * @throws InvalidProviderException
+ */
private function getProvider(string $providerId, IUser $user): IProvider {
$providers = $this->providerLoader->getProviders($user);
@@ -40,8 +39,6 @@ class ProviderManager {
/**
* Try to enable the provider with the given id for the given user
*
- * @param IUser $user
- *
* @return bool whether the provider supports this operation
*/
public function tryEnableProviderFor(string $providerId, IUser $user): bool {
@@ -51,9 +48,9 @@ class ProviderManager {
$provider->enableFor($user);
$this->providerRegistry->enableProviderFor($provider, $user);
return true;
- } else {
- return false;
}
+
+ return false;
}
/**
@@ -70,8 +67,8 @@ class ProviderManager {
$provider->disableFor($user);
$this->providerRegistry->disableProviderFor($provider, $user);
return true;
- } else {
- return false;
}
+
+ return false;
}
}