]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix psalm issue about userCounts
authorCarl Schwan <carl@carlschwan.eu>
Fri, 11 Mar 2022 13:17:29 +0000 (14:17 +0100)
committerCarl Schwan <carl@carlschwan.eu>
Fri, 11 Mar 2022 13:17:29 +0000 (14:17 +0100)
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
apps/user_ldap/lib/User_LDAP.php
apps/user_ldap/lib/User_Proxy.php
build/psalm-baseline.xml
lib/private/Support/Subscription/Registry.php

index 9cd90451ea37e6d85c95ef2639aa3385b0e6d49a..f0525daa9744a85cae56bdf5ea57f5809e14c087 100644 (file)
@@ -47,9 +47,10 @@ use OCA\User_LDAP\User\User;
 use OCP\IConfig;
 use OCP\IUserSession;
 use OCP\Notification\IManager as INotificationManager;
+use OCP\User\Backend\ICountUsersBackend;
 use Psr\Log\LoggerInterface;
 
-class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserInterface, IUserLDAP {
+class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserInterface, IUserLDAP, ICountUsersBackend {
        /** @var \OCP\IConfig */
        protected $ocConfig;
 
index 183c90493cfa287204129b29d7ac7f30c48f02d8..040d4f5aa696448aa150e6aa3f3604dac355cb40 100644 (file)
@@ -35,8 +35,9 @@ use OCA\User_LDAP\User\User;
 use OCP\IConfig;
 use OCP\IUserSession;
 use OCP\Notification\IManager as INotificationManager;
+use OCP\User\Backend\ICountUsersBackend;
 
-class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface, IUserLDAP {
+class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface, IUserLDAP, ICountUsersBackend {
        private $backends = [];
        /** @var User_LDAP */
        private $refBackend = null;
index 44a113f1238e9d01262dea6b914f2d741babab4a..a167be63eb15e623616c5b4018791f291da4ee50 100644 (file)
     </UndefinedInterfaceMethod>
   </file>
   <file src="lib/private/Support/Subscription/Registry.php">
-    <UndefinedInterfaceMethod occurrences="2">
-      <code>countUsers</code>
+    <UndefinedInterfaceMethod occurrences="1">
       <code>getSupportedApps</code>
     </UndefinedInterfaceMethod>
   </file>
index 1298337acb2abbf2ab782660d82a7793631924fb..ba3642d021c4dd6adbd5a32447ae8838ef5b48da 100644 (file)
@@ -34,6 +34,7 @@ use OCP\IGroupManager;
 use OCP\IServerContainer;
 use OCP\IUserManager;
 use OCP\Notification\IManager;
+use OCP\User\Backend\ICountUsersBackend;
 use OCP\Support\Subscription\Exception\AlreadyRegisteredException;
 use OCP\Support\Subscription\IRegistry;
 use OCP\Support\Subscription\ISubscription;
@@ -189,6 +190,7 @@ class Registry implements IRegistry {
                $backends = $this->userManager->getBackends();
                foreach ($backends as $backend) {
                        if ($backend->implementsActions(Backend::COUNT_USERS)) {
+                               /** @var ICountUsersBackend $backend */
                                $backendUsers = $backend->countUsers();
                                if ($backendUsers !== false) {
                                        $userCount += $backendUsers;