diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-04-22 18:11:32 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-04-30 09:23:58 +0200 |
commit | 672923f0a6ab5a692273326250fe1394b4e41bd9 (patch) | |
tree | 83f972fa6d854199a5be687531e99688dbb2ab2e /lib/private/User | |
parent | ce2d6cd81ec5aa66e9cf5040c211e1239b4bc830 (diff) | |
download | nextcloud-server-672923f0a6ab5a692273326250fe1394b4e41bd9.tar.gz nextcloud-server-672923f0a6ab5a692273326250fe1394b4e41bd9.zip |
fix: Fix newly spotted psalm issues, add exhaustive typed magic properties for LDAP classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/User')
-rw-r--r-- | lib/private/User/Manager.php | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 66a9529483e..a8664dd2048 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -79,35 +79,26 @@ class Manager extends PublicEmitter implements IUserManager { /** * @var \OCP\UserInterface[] $backends */ - private $backends = []; + private array $backends = []; /** - * @var \OC\User\User[] $cachedUsers + * @var array<string,\OC\User\User> $cachedUsers */ - private $cachedUsers = []; + private array $cachedUsers = []; - /** @var IConfig */ - private $config; - - /** @var ICache */ - private $cache; - - /** @var IEventDispatcher */ - private $eventDispatcher; + private ICache $cache; private DisplayNameCache $displayNameCache; - public function __construct(IConfig $config, + public function __construct( + private IConfig $config, ICacheFactory $cacheFactory, - IEventDispatcher $eventDispatcher) { - $this->config = $config; + private IEventDispatcher $eventDispatcher, + ) { $this->cache = new WithLocalCache($cacheFactory->createDistributed('user_backend_map')); - $cachedUsers = &$this->cachedUsers; - $this->listen('\OC\User', 'postDelete', function ($user) use (&$cachedUsers) { - /** @var \OC\User\User $user */ - unset($cachedUsers[$user->getUID()]); + $this->listen('\OC\User', 'postDelete', function (IUser $user): void { + unset($this->cachedUsers[$user->getUID()]); }); - $this->eventDispatcher = $eventDispatcher; $this->displayNameCache = new DisplayNameCache($cacheFactory, $this); } |