diff options
author | Faraz Samapoor <fsa@adlas.at> | 2023-06-20 15:22:22 +0330 |
---|---|---|
committer | Louis <6653109+artonge@users.noreply.github.com> | 2023-06-24 23:14:23 +0200 |
commit | 0db057262685c7a64c690de7a0e162dd52ccea55 (patch) | |
tree | 142dc4eac829f50692a0df8ebede081bd8e853d6 /core | |
parent | c01129947e9fecd26f10ef588cc0940ff187dc83 (diff) | |
download | nextcloud-server-0db057262685c7a64c690de7a0e162dd52ccea55.tar.gz nextcloud-server-0db057262685c7a64c690de7a0e162dd52ccea55.zip |
Adds constructor to the Based class.
Based on:
https://github.com/nextcloud/server/pull/38775#discussion_r1227641788
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
Diffstat (limited to 'core')
-rw-r--r-- | core/Command/TwoFactorAuth/Base.php | 7 | ||||
-rw-r--r-- | core/Command/TwoFactorAuth/Cleanup.php | 11 | ||||
-rw-r--r-- | core/Command/TwoFactorAuth/Disable.php | 5 | ||||
-rw-r--r-- | core/Command/TwoFactorAuth/Enable.php | 5 | ||||
-rw-r--r-- | core/Command/TwoFactorAuth/State.php | 5 |
5 files changed, 27 insertions, 6 deletions
diff --git a/core/Command/TwoFactorAuth/Base.php b/core/Command/TwoFactorAuth/Base.php index 27bd381d951..a36cb2af374 100644 --- a/core/Command/TwoFactorAuth/Base.php +++ b/core/Command/TwoFactorAuth/Base.php @@ -30,7 +30,12 @@ use OCP\IUserManager; use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; class Base extends \OC\Core\Command\Base { - protected IUserManager $userManager; + public function __construct( + ?string $name, + protected IUserManager $userManager, + ) { + parent::__construct($name); + } /** * Return possible values for the named option diff --git a/core/Command/TwoFactorAuth/Cleanup.php b/core/Command/TwoFactorAuth/Cleanup.php index 125a7b01f4a..e70c93bcc1c 100644 --- a/core/Command/TwoFactorAuth/Cleanup.php +++ b/core/Command/TwoFactorAuth/Cleanup.php @@ -27,13 +27,20 @@ declare(strict_types=1); namespace OC\Core\Command\TwoFactorAuth; use OCP\Authentication\TwoFactorAuth\IRegistry; +use OCP\IUserManager; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class Cleanup extends Base { - public function __construct(private IRegistry $registry) { - parent::__construct(); + public function __construct( + private IRegistry $registry, + protected IUserManager $userManager, + ) { + parent::__construct( + null, + $userManager, + ); } protected function configure() { diff --git a/core/Command/TwoFactorAuth/Disable.php b/core/Command/TwoFactorAuth/Disable.php index 1de4d711e0e..08f1422d458 100644 --- a/core/Command/TwoFactorAuth/Disable.php +++ b/core/Command/TwoFactorAuth/Disable.php @@ -33,7 +33,10 @@ class Disable extends Base { private ProviderManager $manager, protected IUserManager $userManager, ) { - parent::__construct('twofactorauth:disable'); + parent::__construct( + 'twofactorauth:disable', + $userManager, + ); } protected function configure() { diff --git a/core/Command/TwoFactorAuth/Enable.php b/core/Command/TwoFactorAuth/Enable.php index 38d6894b462..2138fcd6dbb 100644 --- a/core/Command/TwoFactorAuth/Enable.php +++ b/core/Command/TwoFactorAuth/Enable.php @@ -33,7 +33,10 @@ class Enable extends Base { private ProviderManager $manager, protected IUserManager $userManager, ) { - parent::__construct('twofactorauth:enable'); + parent::__construct( + 'twofactorauth:enable', + $userManager, + ); } protected function configure() { diff --git a/core/Command/TwoFactorAuth/State.php b/core/Command/TwoFactorAuth/State.php index d4e930b7c9d..acd35638ee6 100644 --- a/core/Command/TwoFactorAuth/State.php +++ b/core/Command/TwoFactorAuth/State.php @@ -37,7 +37,10 @@ class State extends Base { private IRegistry $registry, protected IUserManager $userManager, ) { - parent::__construct('twofactorauth:state'); + parent::__construct( + 'twofactorauth:state', + $userManager, + ); } protected function configure() { |