Remove unused dependencies in encryption app setup

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2020-11-22 21:56:00 +01:00
parent 032de4f333
commit c832e6180b
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 4 additions and 38 deletions

View File

@ -29,40 +29,15 @@ namespace OCA\Encryption\Users;
use OCA\Encryption\Crypto\Crypt;
use OCA\Encryption\KeyManager;
use OCP\ILogger;
use OCP\IUserSession;
class Setup {
/**
* @var Crypt
*/
/** @var Crypt */
private $crypt;
/**
* @var KeyManager
*/
/** @var KeyManager */
private $keyManager;
/**
* @var ILogger
*/
private $logger;
/**
* @var bool|string
*/
private $user;
/**
* @param ILogger $logger
* @param IUserSession $userSession
* @param Crypt $crypt
* @param KeyManager $keyManager
*/
public function __construct(ILogger $logger,
IUserSession $userSession,
Crypt $crypt,
public function __construct(Crypt $crypt,
KeyManager $keyManager) {
$this->logger = $logger;
$this->user = $userSession && $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
$this->crypt = $crypt;
$this->keyManager = $keyManager;
}

View File

@ -30,8 +30,6 @@ namespace OCA\Encryption\Tests\Users;
use OCA\Encryption\Crypto\Crypt;
use OCA\Encryption\KeyManager;
use OCA\Encryption\Users\Setup;
use OCP\ILogger;
use OCP\IUserSession;
use Test\TestCase;
class SetupTest extends TestCase {
@ -50,10 +48,6 @@ class SetupTest extends TestCase {
protected function setUp(): void {
parent::setUp();
$logMock = $this->createMock(ILogger::class);
$userSessionMock = $this->getMockBuilder(IUserSession::class)
->disableOriginalConstructor()
->getMock();
$this->cryptMock = $this->getMockBuilder(Crypt::class)
->disableOriginalConstructor()
->getMock();
@ -62,10 +56,7 @@ class SetupTest extends TestCase {
->disableOriginalConstructor()
->getMock();
/** @var \OCP\ILogger $logMock */
/** @var \OCP\IUserSession $userSessionMock */
$this->instance = new Setup($logMock,
$userSessionMock,
$this->instance = new Setup(
$this->cryptMock,
$this->keyManagerMock);
}