diff options
Diffstat (limited to 'lib/private/Group')
-rw-r--r-- | lib/private/Group/Manager.php | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index eeff2f35c45..694b6de30c4 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -101,26 +101,15 @@ class Manager extends PublicEmitter implements IGroupManager { $this->logger = $logger; $this->displayNameCache = new DisplayNameCache($cacheFactory, $this); - $cachedGroups = &$this->cachedGroups; - $cachedUserGroups = &$this->cachedUserGroups; - $this->listen('\OC\Group', 'postDelete', function ($group) use (&$cachedGroups, &$cachedUserGroups) { - /** - * @var \OC\Group\Group $group - */ - unset($cachedGroups[$group->getGID()]); - $cachedUserGroups = []; + $this->listen('\OC\Group', 'postDelete', function (IGroup $group): void { + unset($this->cachedGroups[$group->getGID()]); + $this->cachedUserGroups = []; }); - $this->listen('\OC\Group', 'postAddUser', function ($group) use (&$cachedUserGroups) { - /** - * @var \OC\Group\Group $group - */ - $cachedUserGroups = []; + $this->listen('\OC\Group', 'postAddUser', function (IGroup $group): void { + $this->cachedUserGroups = []; }); - $this->listen('\OC\Group', 'postRemoveUser', function ($group) use (&$cachedUserGroups) { - /** - * @var \OC\Group\Group $group - */ - $cachedUserGroups = []; + $this->listen('\OC\Group', 'postRemoveUser', function (IGroup $group): void { + $this->cachedUserGroups = []; }); } |