summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-05-03 11:15:24 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-05-12 15:06:18 +0200
commitec6b83cc1891214c7fa3a236626807b4335f9a2f (patch)
treeb5f12993172528ddec15b7b8ae6a09a0080fedd7 /apps/user_ldap/lib
parent5a0b28d603e142051967175f023b698ff7e262db (diff)
downloadnextcloud-server-ec6b83cc1891214c7fa3a236626807b4335f9a2f.tar.gz
nextcloud-server-ec6b83cc1891214c7fa3a236626807b4335f9a2f.zip
Add stricter psalm type for CappedMemoryCache
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/Group_LDAP.php12
-rw-r--r--apps/user_ldap/lib/Helper.php13
-rw-r--r--apps/user_ldap/lib/User/Manager.php51
3 files changed, 24 insertions, 52 deletions
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
index f9d9b061743..8fcb10cb850 100644
--- a/apps/user_ldap/lib/Group_LDAP.php
+++ b/apps/user_ldap/lib/Group_LDAP.php
@@ -55,12 +55,12 @@ use Psr\Log\LoggerInterface;
class Group_LDAP extends BackendUtility implements GroupInterface, IGroupLDAP, IGetDisplayNameBackend, IDeleteGroupBackend {
protected $enabled = false;
- /** @var string[][] $cachedGroupMembers array of users with gid as key */
- protected $cachedGroupMembers;
- /** @var string[] $cachedGroupsByMember array of groups with uid as key */
- protected $cachedGroupsByMember;
- /** @var string[] $cachedNestedGroups array of groups with gid (DN) as key */
- protected $cachedNestedGroups;
+ /** @var CappedMemoryCache<string[]> $cachedGroupMembers array of users with gid as key */
+ protected CappedMemoryCache $cachedGroupMembers;
+ /** @var CappedMemoryCache<string[]> $cachedGroupsByMember array of groups with uid as key */
+ protected CappedMemoryCache $cachedGroupsByMember;
+ /** @var CappedMemoryCache<string[]> $cachedNestedGroups array of groups with gid (DN) as key */
+ protected CappedMemoryCache $cachedNestedGroups;
/** @var GroupPluginManager */
protected $groupPluginManager;
/** @var LoggerInterface */
diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php
index 437fab6b6a8..3ca5de67874 100644
--- a/apps/user_ldap/lib/Helper.php
+++ b/apps/user_ldap/lib/Helper.php
@@ -35,15 +35,10 @@ use OCP\IConfig;
use OCP\IDBConnection;
class Helper {
-
- /** @var IConfig */
- private $config;
-
- /** @var IDBConnection */
- private $connection;
-
- /** @var CappedMemoryCache */
- protected $sanitizeDnCache;
+ private IConfig $config;
+ private IDBConnection $connection;
+ /** @var CappedMemoryCache<string> */
+ protected CappedMemoryCache $sanitizeDnCache;
public function __construct(IConfig $config,
IDBConnection $connection) {
diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php
index e752b113e3f..e52b093f5af 100644
--- a/apps/user_ldap/lib/User/Manager.php
+++ b/apps/user_ldap/lib/User/Manager.php
@@ -47,43 +47,20 @@ use Psr\Log\LoggerInterface;
* cache
*/
class Manager {
- /** @var Access */
- protected $access;
-
- /** @var IConfig */
- protected $ocConfig;
-
- /** @var IDBConnection */
- protected $db;
-
- /** @var IUserManager */
- protected $userManager;
-
- /** @var INotificationManager */
- protected $notificationManager;
-
- /** @var FilesystemHelper */
- protected $ocFilesystem;
-
- /** @var LoggerInterface */
- protected $logger;
-
- /** @var Image */
- protected $image;
-
- /** @param \OCP\IAvatarManager */
- protected $avatarManager;
-
- /**
- * @var CappedMemoryCache $usersByDN
- */
- protected $usersByDN;
- /**
- * @var CappedMemoryCache $usersByUid
- */
- protected $usersByUid;
- /** @var IManager */
- private $shareManager;
+ protected ?Access $access = null;
+ protected IConfig $ocConfig;
+ protected IDBConnection $db;
+ protected IUserManager $userManager;
+ protected INotificationManager $notificationManager;
+ protected FilesystemHelper $ocFilesystem;
+ protected LoggerInterface $logger;
+ protected Image $image;
+ protected IAvatarManager $avatarManager;
+ /** @var CappedMemoryCache<User> $usersByDN */
+ protected CappedMemoryCache $usersByDN;
+ /** @var CappedMemoryCache<User> $usersByUid */
+ protected CappedMemoryCache $usersByUid;
+ private IManager $shareManager;
public function __construct(
IConfig $ocConfig,