]> source.dussan.org Git - nextcloud-server.git/commitdiff
Adds constructor to the Based class.
authorFaraz Samapoor <fsa@adlas.at>
Tue, 20 Jun 2023 11:52:22 +0000 (15:22 +0330)
committerLouis <6653109+artonge@users.noreply.github.com>
Sat, 24 Jun 2023 21:14:23 +0000 (23:14 +0200)
Based on:
https://github.com/nextcloud/server/pull/38775#discussion_r1227641788

Signed-off-by: Faraz Samapoor <fsa@adlas.at>
core/Command/TwoFactorAuth/Base.php
core/Command/TwoFactorAuth/Cleanup.php
core/Command/TwoFactorAuth/Disable.php
core/Command/TwoFactorAuth/Enable.php
core/Command/TwoFactorAuth/State.php

index 27bd381d95117f7bbd4cf9d91e49b6d0e23b5476..a36cb2af3742efb17804ae7dba19562e31f7b25b 100644 (file)
@@ -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
index 125a7b01f4afde1527c2db64ff7b614b9f890d94..e70c93bcc1c9d1238aad3977546a00d0e8311106 100644 (file)
@@ -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() {
index 1de4d711e0e97eecbc1003983957cda7b0fc12a2..08f1422d458f293f7e4ecbe7680546e8f25bf367 100644 (file)
@@ -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() {
index 38d6894b4624ebe2acb720d35cb0c92638b94fec..2138fcd6dbbd3687baed9ed53e4c48464d0121b5 100644 (file)
@@ -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() {
index d4e930b7c9d252c8bf7cbd5f02a25427c845545a..acd35638ee6a07968c26b867bd8b69915dabb884 100644 (file)
@@ -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() {