diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-01-30 11:48:09 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-01-30 16:03:17 +0100 |
commit | c1d67cc614ffd95f828ab9cad6e7b26846c7a67d (patch) | |
tree | 6f759773c41587ca22f83740e78cde1166b9625e | |
parent | cc26a503a30ec6211bda539dbf3bbccec98c9b6d (diff) | |
download | nextcloud-server-c1d67cc614ffd95f828ab9cad6e7b26846c7a67d.tar.gz nextcloud-server-c1d67cc614ffd95f828ab9cad6e7b26846c7a67d.zip |
chore: Fix DI for Encryption\DecryptAll command
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | core/register_command.php | 1 | ||||
-rw-r--r-- | lib/private/Encryption/DecryptAll.php | 24 | ||||
-rw-r--r-- | lib/private/Encryption/Manager.php | 37 |
3 files changed, 15 insertions, 47 deletions
diff --git a/core/register_command.php b/core/register_command.php index ca6d3579c65..c0df3da9a06 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @author Björn Schießle <bjoern@schiessle.org> * @author Christian Kampka <christian@kampka.net> * @author Christoph Wurst <christoph@winzerhof-wurst.at> + * @author Côme Chilliet <come.chilliet@nextcloud.com> * @author Daniel Calviño Sánchez <danxuliu@gmail.com> * @author Daniel Kesselberg <mail@danielkesselberg.de> * @author Denis Mosolov <denismosolov@gmail.com> diff --git a/lib/private/Encryption/DecryptAll.php b/lib/private/Encryption/DecryptAll.php index 7bf4ce62d28..98ea35c62e0 100644 --- a/lib/private/Encryption/DecryptAll.php +++ b/lib/private/Encryption/DecryptAll.php @@ -31,6 +31,7 @@ namespace OC\Encryption; use OC\Encryption\Exceptions\DecryptionFailedException; use OC\Files\View; use OCP\Encryption\IEncryptionModule; +use OCP\Encryption\IManager; use OCP\IUserManager; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Input\InputInterface; @@ -43,31 +44,14 @@ class DecryptAll { /** @var InputInterface */ protected $input; - /** @var Manager */ - protected $encryptionManager; - - /** @var IUserManager */ - protected $userManager; - - /** @var View */ - protected $rootView; - /** @var array files which couldn't be decrypted */ protected $failed; - /** - * @param Manager $encryptionManager - * @param IUserManager $userManager - * @param View $rootView - */ public function __construct( - Manager $encryptionManager, - IUserManager $userManager, - View $rootView + protected IManager $encryptionManager, + protected IUserManager $userManager, + protected View $rootView ) { - $this->encryptionManager = $encryptionManager; - $this->userManager = $userManager; - $this->rootView = $rootView; $this->failed = []; } diff --git a/lib/private/Encryption/Manager.php b/lib/private/Encryption/Manager.php index 28bee7dacb7..f48d259eea0 100644 --- a/lib/private/Encryption/Manager.php +++ b/lib/private/Encryption/Manager.php @@ -39,34 +39,17 @@ use OCP\IL10N; use Psr\Log\LoggerInterface; class Manager implements IManager { - /** @var array */ - protected $encryptionModules; - - /** @var IConfig */ - protected $config; - - protected LoggerInterface $logger; - - /** @var Il10n */ - protected $l; - - /** @var View */ - protected $rootView; - - /** @var Util */ - protected $util; - - /** @var ArrayCache */ - protected $arrayCache; - - public function __construct(IConfig $config, LoggerInterface $logger, IL10N $l10n, View $rootView, Util $util, ArrayCache $arrayCache) { + protected array $encryptionModules; + + public function __construct( + protected IConfig $config, + protected LoggerInterface $logger, + protected IL10N $l, + protected View $rootView, + protected Util $util, + protected ArrayCache $arrayCache, + ) { $this->encryptionModules = []; - $this->config = $config; - $this->logger = $logger; - $this->l = $l10n; - $this->rootView = $rootView; - $this->util = $util; - $this->arrayCache = $arrayCache; } /** |