Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-03-11 16:17:29 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-03-11 16:17:29 +0300
commit8d7380a15de1ebeaced9bada661c5f137380a674 (patch)
tree5df8d78184e82faddc48367ccf58ef97ef4b6e93
parent3a0b934f842b01973f7d56f7e46a618a28680cd3 (diff)
Fix psalm issue about userCounts
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r--apps/user_ldap/lib/User_LDAP.php3
-rw-r--r--apps/user_ldap/lib/User_Proxy.php3
-rw-r--r--build/psalm-baseline.xml3
-rw-r--r--lib/private/Support/Subscription/Registry.php2
4 files changed, 7 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index 9cd90451ea3..f0525daa974 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -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;
diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php
index 183c90493cf..040d4f5aa69 100644
--- a/apps/user_ldap/lib/User_Proxy.php
+++ b/apps/user_ldap/lib/User_Proxy.php
@@ -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;
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml
index 44a113f1238..a167be63eb1 100644
--- a/build/psalm-baseline.xml
+++ b/build/psalm-baseline.xml
@@ -4332,8 +4332,7 @@
</UndefinedInterfaceMethod>
</file>
<file src="lib/private/Support/Subscription/Registry.php">
- <UndefinedInterfaceMethod occurrences="2">
- <code>countUsers</code>
+ <UndefinedInterfaceMethod occurrences="1">
<code>getSupportedApps</code>
</UndefinedInterfaceMethod>
</file>
diff --git a/lib/private/Support/Subscription/Registry.php b/lib/private/Support/Subscription/Registry.php
index 1298337acb2..ba3642d021c 100644
--- a/lib/private/Support/Subscription/Registry.php
+++ b/lib/private/Support/Subscription/Registry.php
@@ -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;