in core/Command and /TwoFactorAuth classes.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
use Symfony\Component\Console\Output\OutputInterface;
class Check extends Base {
- private SystemConfig $config;
-
- public function __construct(SystemConfig $config) {
+ public function __construct(private SystemConfig $config) {
parent::__construct();
- $this->config = $config;
}
protected function configure() {
use Symfony\Component\Console\Output\OutputInterface;
class Status extends Base {
- private IConfig $config;
- private Defaults $themingDefaults;
-
- public function __construct(IConfig $config, Defaults $themingDefaults) {
+ public function __construct(
+ private IConfig $config,
+ private Defaults $themingDefaults,
+ ) {
parent::__construct('status');
-
- $this->config = $config;
- $this->themingDefaults = $themingDefaults;
}
protected function configure() {
use Symfony\Component\Console\Output\OutputInterface;
class Cleanup extends Base {
- private IRegistry $registry;
-
- public function __construct(IRegistry $registry) {
+ public function __construct(private IRegistry $registry) {
parent::__construct();
-
- $this->registry = $registry;
}
protected function configure() {
use Symfony\Component\Console\Output\OutputInterface;
class Disable extends Base {
- private ProviderManager $manager;
-
- public function __construct(ProviderManager $manager, IUserManager $userManager) {
+ public function __construct(
+ private ProviderManager $manager,
+ protected IUserManager $userManager,
+ ) {
parent::__construct('twofactorauth:disable');
- $this->manager = $manager;
- $this->userManager = $userManager;
}
protected function configure() {
use Symfony\Component\Console\Output\OutputInterface;
class Enable extends Base {
- private ProviderManager $manager;
-
- public function __construct(ProviderManager $manager, IUserManager $userManager) {
+ public function __construct(
+ private ProviderManager $manager,
+ protected IUserManager $userManager,
+ ) {
parent::__construct('twofactorauth:enable');
- $this->manager = $manager;
- $this->userManager = $userManager;
}
protected function configure() {
use Symfony\Component\Console\Output\OutputInterface;
class Enforce extends Command {
- private MandatoryTwoFactor $mandatoryTwoFactor;
-
- public function __construct(MandatoryTwoFactor $mandatoryTwoFactor) {
+ public function __construct(private MandatoryTwoFactor $mandatoryTwoFactor) {
parent::__construct();
-
- $this->mandatoryTwoFactor = $mandatoryTwoFactor;
}
protected function configure() {
use Symfony\Component\Console\Output\OutputInterface;
class State extends Base {
- private IRegistry $registry;
-
- public function __construct(IRegistry $registry, IUserManager $userManager) {
+ public function __construct(
+ private IRegistry $registry,
+ protected IUserManager $userManager,
+ ) {
parent::__construct('twofactorauth:state');
-
- $this->registry = $registry;
- $this->userManager = $userManager;
}
protected function configure() {
public const ERROR_INVALID_ARGUMENTS = 4;
public const ERROR_FAILURE = 5;
- private IConfig $config;
- private LoggerInterface $logger;
- private Installer $installer;
-
- public function __construct(IConfig $config, LoggerInterface $logger, Installer $installer) {
+ public function __construct(
+ private IConfig $config,
+ private LoggerInterface $logger,
+ private Installer $installer,
+ ) {
parent::__construct();
- $this->config = $config;
- $this->logger = $logger;
- $this->installer = $installer;
}
protected function configure() {