diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-11-23 16:23:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-23 16:23:21 +0100 |
commit | d9e0efbf72e1f57abfbfffd3e547ba171e867d78 (patch) | |
tree | 16ae89cda208a81128f3757cc0ad7680954a7e36 /apps/encryption/lib | |
parent | 5d88686b184ad9aca7c68d2a1a37da0dcef8fc97 (diff) | |
parent | efe644137d1d2d8ad1e11fbf8cd3109a679d6fc1 (diff) | |
download | nextcloud-server-d9e0efbf72e1f57abfbfffd3e547ba171e867d78.tar.gz nextcloud-server-d9e0efbf72e1f57abfbfffd3e547ba171e867d78.zip |
Merge pull request #24289 from nextcloud/techdebt/noid/encryption-make-application-class-dependency-free
[encryption] Remove dependency fetching inside the constructor and mo…
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r-- | apps/encryption/lib/AppInfo/Application.php | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/apps/encryption/lib/AppInfo/Application.php b/apps/encryption/lib/AppInfo/Application.php index a5cbb30870c..6674abc972d 100644 --- a/apps/encryption/lib/AppInfo/Application.php +++ b/apps/encryption/lib/AppInfo/Application.php @@ -44,23 +44,15 @@ use OCP\Encryption\IManager; use OCP\IConfig; class Application extends \OCP\AppFramework\App { - - /** @var IManager */ - private $encryptionManager; - /** @var IConfig */ - private $config; - /** * @param array $urlParams */ public function __construct($urlParams = []) { parent::__construct('encryption', $urlParams); - $this->encryptionManager = \OC::$server->getEncryptionManager(); - $this->config = \OC::$server->getConfig(); } - public function setUp() { - if ($this->encryptionManager->isEnabled()) { + public function setUp(IManager $encryptionManager) { + if ($encryptionManager->isEnabled()) { /** @var Setup $setup */ $setup = $this->getContainer()->query(Setup::class); $setup->setupSystem(); @@ -70,8 +62,8 @@ class Application extends \OCP\AppFramework\App { /** * register hooks */ - public function registerHooks() { - if (!$this->config->getSystemValueBool('maintenance')) { + public function registerHooks(IConfig $config) { + if (!$config->getSystemValueBool('maintenance')) { $container = $this->getContainer(); $server = $container->getServer(); // Register our hooks and fire them. @@ -96,11 +88,10 @@ class Application extends \OCP\AppFramework\App { } } - public function registerEncryptionModule() { + public function registerEncryptionModule(IManager $encryptionManager) { $container = $this->getContainer(); - - $this->encryptionManager->registerEncryptionModule( + $encryptionManager->registerEncryptionModule( Encryption::ID, Encryption::DISPLAY_NAME, function () use ($container) { |