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>
pull/38775/head
Faraz Samapoor 3 years ago committed by Louis
parent c01129947e
commit 0db0572626
  1. 7
      core/Command/TwoFactorAuth/Base.php
  2. 11
      core/Command/TwoFactorAuth/Cleanup.php
  3. 5
      core/Command/TwoFactorAuth/Disable.php
  4. 5
      core/Command/TwoFactorAuth/Enable.php
  5. 5
      core/Command/TwoFactorAuth/State.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

@ -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() {

@ -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() {

@ -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() {

@ -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() {

Loading…
Cancel
Save