Uses PHP8's constructor property promotion in core/Command/Encryption classes.

Signed-off-by: Faraz Samapoor <fsa@adlas.at>
pull/38762/head
Faraz Samapoor 3 years ago committed by Louis
parent 14ac281acf
commit f9a9ad50c3
  1. 19
      core/Command/Encryption/ChangeKeyStorageRoot.php
  2. 21
      core/Command/Encryption/DecryptAll.php
  3. 5
      core/Command/Encryption/Disable.php
  4. 13
      core/Command/Encryption/Enable.php
  5. 16
      core/Command/Encryption/EncryptAll.php
  6. 9
      core/Command/Encryption/ListModules.php
  7. 20
      core/Command/Encryption/MigrateKeyStorage.php
  8. 9
      core/Command/Encryption/SetDefaultModule.php
  9. 5
      core/Command/Encryption/ShowKeyStorageRoot.php
  10. 5
      core/Command/Encryption/Status.php

@ -40,19 +40,14 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
class ChangeKeyStorageRoot extends Command {
protected View $rootView;
protected IUserManager $userManager;
protected IConfig $config;
protected Util $util;
protected QuestionHelper $questionHelper;
public function __construct(View $view, IUserManager $userManager, IConfig $config, Util $util, QuestionHelper $questionHelper) {
public function __construct(
protected View $rootView,
protected IUserManager $userManager,
protected IConfig $config,
protected Util $util,
protected QuestionHelper $questionHelper,
) {
parent::__construct();
$this->rootView = $view;
$this->userManager = $userManager;
$this->config = $config;
$this->util = $util;
$this->questionHelper = $questionHelper;
}
protected function configure() {

@ -41,28 +41,17 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
class DecryptAll extends Command {
protected IManager $encryptionManager;
protected IAppManager $appManager;
protected IConfig $config;
protected QuestionHelper $questionHelper;
protected bool $wasTrashbinEnabled;
protected bool $wasMaintenanceModeEnabled;
protected \OC\Encryption\DecryptAll $decryptAll;
public function __construct(
IManager $encryptionManager,
IAppManager $appManager,
IConfig $config,
\OC\Encryption\DecryptAll $decryptAll,
QuestionHelper $questionHelper
protected IManager $encryptionManager,
protected IAppManager $appManager,
protected IConfig $config,
protected \OC\Encryption\DecryptAll $decryptAll,
protected QuestionHelper $questionHelper,
) {
parent::__construct();
$this->appManager = $appManager;
$this->encryptionManager = $encryptionManager;
$this->config = $config;
$this->decryptAll = $decryptAll;
$this->questionHelper = $questionHelper;
}
/**

@ -27,11 +27,8 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class Disable extends Command {
protected IConfig $config;
public function __construct(IConfig $config) {
public function __construct(protected IConfig $config) {
parent::__construct();
$this->config = $config;
}
protected function configure() {

@ -29,14 +29,11 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class Enable extends Command {
protected IConfig $config;
protected IManager $encryptionManager;
public function __construct(IConfig $config, IManager $encryptionManager) {
public function __construct(
protected IConfig $config,
protected IManager $encryptionManager,
) {
parent::__construct();
$this->encryptionManager = $encryptionManager;
$this->config = $config;
}
protected function configure() {
@ -70,7 +67,7 @@ class Enable extends Command {
return 1;
}
$output->writeln('Default module: ' . $defaultModule);
return 0;
}
}

@ -36,24 +36,16 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
class EncryptAll extends Command {
protected IManager $encryptionManager;
protected IAppManager $appManager;
protected IConfig $config;
protected QuestionHelper $questionHelper;
protected bool $wasTrashbinEnabled = false;
protected bool $wasMaintenanceModeEnabled;
public function __construct(
IManager $encryptionManager,
IAppManager $appManager,
IConfig $config,
QuestionHelper $questionHelper
protected IManager $encryptionManager,
protected IAppManager $appManager,
protected IConfig $config,
protected QuestionHelper $questionHelper,
) {
parent::__construct();
$this->appManager = $appManager;
$this->encryptionManager = $encryptionManager;
$this->config = $config;
$this->questionHelper = $questionHelper;
}
/**

@ -30,16 +30,11 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ListModules extends Base {
protected IManager $encryptionManager;
protected IConfig $config;
public function __construct(
IManager $encryptionManager,
IConfig $config
protected IManager $encryptionManager,
protected IConfig $config,
) {
parent::__construct();
$this->encryptionManager = $encryptionManager;
$this->config = $config;
}
protected function configure() {

@ -38,20 +38,14 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class MigrateKeyStorage extends Command {
protected View $rootView;
protected IUserManager $userManager;
protected IConfig $config;
protected Util $util;
protected QuestionHelper $questionHelper;
private ICrypto $crypto;
public function __construct(View $view, IUserManager $userManager, IConfig $config, Util $util, ICrypto $crypto) {
public function __construct(
protected View $rootView,
protected IUserManager $userManager,
protected IConfig $config,
protected Util $util,
private ICrypto $crypto,
) {
parent::__construct();
$this->rootView = $view;
$this->userManager = $userManager;
$this->config = $config;
$this->util = $util;
$this->crypto = $crypto;
}
protected function configure() {

@ -31,16 +31,11 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class SetDefaultModule extends Command {
protected IManager $encryptionManager;
protected IConfig $config;
public function __construct(
IManager $encryptionManager,
IConfig $config
protected IManager $encryptionManager,
protected IConfig $config,
) {
parent::__construct();
$this->encryptionManager = $encryptionManager;
$this->config = $config;
}
protected function configure() {

@ -29,11 +29,8 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ShowKeyStorageRoot extends Command {
protected Util $util;
public function __construct(Util $util) {
public function __construct(protected Util $util) {
parent::__construct();
$this->util = $util;
}
protected function configure() {

@ -27,11 +27,8 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class Status extends Base {
protected IManager $encryptionManager;
public function __construct(IManager $encryptionManager) {
public function __construct(protected IManager $encryptionManager) {
parent::__construct();
$this->encryptionManager = $encryptionManager;
}
protected function configure() {

Loading…
Cancel
Save