|
42 | 42 | * don't use this class directly if you need to get metadata, use \OC\Files\Filesystem::getFileInfo instead |
43 | 43 | */ |
44 | 44 | class Cache extends CacheJail { |
45 | | - /** |
46 | | - * @var \OCA\Files_Sharing\SharedStorage |
47 | | - */ |
| 45 | + /** @var \OCA\Files_Sharing\SharedStorage */ |
48 | 46 | private $storage; |
49 | | - |
50 | | - /** |
51 | | - * @var ICacheEntry |
52 | | - */ |
| 47 | + /** @var ICacheEntry */ |
53 | 48 | private $sourceRootInfo; |
| 49 | + /** @var IUserManager */ |
| 50 | + private $userManager; |
54 | 51 |
|
55 | 52 | private $rootUnchanged = true; |
56 | 53 |
|
57 | 54 | private $ownerDisplayName; |
58 | 55 |
|
59 | 56 | private $numericId; |
60 | 57 |
|
61 | | - /** |
62 | | - * @param \OCA\Files_Sharing\SharedStorage $storage |
63 | | - * @param ICacheEntry $sourceRootInfo |
64 | | - */ |
65 | | - public function __construct($storage, ICacheEntry $sourceRootInfo) { |
| 58 | + public function __construct(SharedStorage $storage, ICacheEntry $sourceRootInfo, IUserManager $userManager) { |
66 | 59 | $this->storage = $storage; |
67 | 60 | $this->sourceRootInfo = $sourceRootInfo; |
| 61 | + $this->userManager = $userManager; |
68 | 62 | $this->numericId = $sourceRootInfo->getStorageId(); |
69 | 63 |
|
70 | 64 | parent::__construct( |
@@ -172,7 +166,7 @@ protected function formatCacheEntry($entry, $path = null) { |
172 | 166 | private function getOwnerDisplayName() { |
173 | 167 | if (!$this->ownerDisplayName) { |
174 | 168 | $uid = $this->storage->getOwner(''); |
175 | | - $user = \OC::$server->get(IUserManager::class)->get($uid); |
| 169 | + $user = $this->userManager->get($uid); |
176 | 170 | if ($user) { |
177 | 171 | $this->ownerDisplayName = $user->getDisplayName(); |
178 | 172 | } else { |
|
0 commit comments