Skip to content

Commit 4412b2b

Browse files
committed
refactor(Wrapper\Encryption): Migrate to strong types
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent d1977b8 commit 4412b2b

2 files changed

Lines changed: 134 additions & 168 deletions

File tree

lib/private/Files/Storage/Wrapper/Encryption.php

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -29,76 +29,32 @@
2929
class Encryption extends Wrapper {
3030
use LocalTempFileTrait;
3131

32-
/** @var string */
33-
private $mountPoint;
34-
35-
/** @var \OC\Encryption\Util */
36-
private $util;
37-
38-
/** @var \OCP\Encryption\IManager */
39-
private $encryptionManager;
40-
41-
private LoggerInterface $logger;
42-
43-
/** @var string */
44-
private $uid;
45-
46-
/** @var array */
47-
protected $unencryptedSize;
48-
49-
/** @var \OCP\Encryption\IFile */
50-
private $fileHelper;
51-
52-
/** @var IMountPoint */
53-
private $mount;
54-
55-
/** @var IStorage */
56-
private $keyStorage;
57-
58-
/** @var Update */
59-
private $update;
60-
61-
/** @var Manager */
62-
private $mountManager;
63-
64-
/** @var array remember for which path we execute the repair step to avoid recursions */
65-
private $fixUnencryptedSizeOf = [];
66-
67-
/** @var ArrayCache */
68-
private $arrayCache;
69-
32+
private string $mountPoint;
33+
protected array $unencryptedSize = [];
34+
private IMountPoint $mount;
35+
/** for which path we execute the repair step to avoid recursions */
36+
private array $fixUnencryptedSizeOf = [];
7037
/** @var CappedMemoryCache<bool> */
7138
private CappedMemoryCache $encryptedPaths;
72-
73-
private $enabled = true;
39+
private bool $enabled = true;
7440

7541
/**
7642
* @param array $parameters
7743
*/
7844
public function __construct(
7945
$parameters,
80-
?IManager $encryptionManager = null,
81-
?Util $util = null,
82-
?LoggerInterface $logger = null,
83-
?IFile $fileHelper = null,
84-
$uid = null,
85-
?IStorage $keyStorage = null,
86-
?Update $update = null,
87-
?Manager $mountManager = null,
88-
?ArrayCache $arrayCache = null,
46+
private IManager $encryptionManager,
47+
private Util $util,
48+
private LoggerInterface $logger,
49+
private IFile $fileHelper,
50+
private ?string $uid,
51+
private IStorage $keyStorage,
52+
private Update $update,
53+
private Manager $mountManager,
54+
private ArrayCache $arrayCache,
8955
) {
9056
$this->mountPoint = $parameters['mountPoint'];
9157
$this->mount = $parameters['mount'];
92-
$this->encryptionManager = $encryptionManager;
93-
$this->util = $util;
94-
$this->logger = $logger;
95-
$this->uid = $uid;
96-
$this->fileHelper = $fileHelper;
97-
$this->keyStorage = $keyStorage;
98-
$this->unencryptedSize = [];
99-
$this->update = $update;
100-
$this->mountManager = $mountManager;
101-
$this->arrayCache = $arrayCache;
10258
$this->encryptedPaths = new CappedMemoryCache();
10359
parent::__construct($parameters);
10460
}

0 commit comments

Comments
 (0)