mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #31542 from nextcloud/psalm-userCounts
Fix psalm issue about userCounts
This commit is contained in:
commit
371fa1c49a
4 changed files with 9 additions and 4 deletions
|
|
@ -47,9 +47,12 @@ use OCA\User_LDAP\User\User;
|
|||
use OCP\IConfig;
|
||||
use OCP\IUserSession;
|
||||
use OCP\Notification\IManager as INotificationManager;
|
||||
use OCP\User\Backend\ICountUsersBackend;
|
||||
use OCP\IUserBackend;
|
||||
use OCP\UserInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserInterface, IUserLDAP {
|
||||
class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, IUserLDAP, ICountUsersBackend {
|
||||
/** @var \OCP\IConfig */
|
||||
protected $ocConfig;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -4317,8 +4317,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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue