Merge pull request #24288 from nextcloud/techdebt/noid/encryption-setup-dependency-cleanup
Remove unused dependencies in encryption app setup
This commit is contained in:
commit
dc5f17f561
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue