diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-10-25 10:20:09 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-10-25 10:20:09 +0200 |
commit | 556e3c84e6c712e2974d6d35edb6abbdfe78dd9b (patch) | |
tree | 165617b1e2b83ee8d4a98ea4be2a70431f321472 /apps/user_ldap | |
parent | 4130a4cbd8e5bb4506ac30a19a91b088aa35dd24 (diff) | |
download | nextcloud-server-556e3c84e6c712e2974d6d35edb6abbdfe78dd9b.tar.gz nextcloud-server-556e3c84e6c712e2974d6d35edb6abbdfe78dd9b.zip |
Fix return type for countUsers method
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/ILDAPUserPlugin.php | 3 | ||||
-rw-r--r-- | apps/user_ldap/lib/UserPluginManager.php | 8 | ||||
-rw-r--r-- | apps/user_ldap/lib/User_LDAP.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/lib/User_Proxy.php | 4 |
4 files changed, 9 insertions, 10 deletions
diff --git a/apps/user_ldap/lib/ILDAPUserPlugin.php b/apps/user_ldap/lib/ILDAPUserPlugin.php index 28754a7eaaf..06b86c50385 100644 --- a/apps/user_ldap/lib/ILDAPUserPlugin.php +++ b/apps/user_ldap/lib/ILDAPUserPlugin.php @@ -24,7 +24,6 @@ namespace OCA\User_LDAP; interface ILDAPUserPlugin { - /** * Check if plugin implements actions * @return int @@ -85,7 +84,7 @@ interface ILDAPUserPlugin { /** * Count the number of users - * @return int|bool + * @return int|false */ public function countUsers(); } diff --git a/apps/user_ldap/lib/UserPluginManager.php b/apps/user_ldap/lib/UserPluginManager.php index 748a210cf60..516338f006b 100644 --- a/apps/user_ldap/lib/UserPluginManager.php +++ b/apps/user_ldap/lib/UserPluginManager.php @@ -65,7 +65,7 @@ class UserPluginManager { \OC::$server->getLogger()->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']); } } - if (method_exists($plugin,'deleteUser')) { + if (method_exists($plugin, 'deleteUser')) { $this->which['deleteUser'] = $plugin; \OC::$server->getLogger()->debug("Registered action deleteUser to plugin ".get_class($plugin), ['app' => 'user_ldap']); } @@ -92,7 +92,7 @@ class UserPluginManager { $plugin = $this->which[Backend::CREATE_USER]; if ($plugin) { - return $plugin->createUser($username,$password); + return $plugin->createUser($username, $password); } throw new \Exception('No plugin implements createUser in this LDAP Backend.'); } @@ -108,7 +108,7 @@ class UserPluginManager { $plugin = $this->which[Backend::SET_PASSWORD]; if ($plugin) { - return $plugin->setPassword($uid,$password); + return $plugin->setPassword($uid, $password); } throw new \Exception('No plugin implements setPassword in this LDAP Backend.'); } @@ -176,7 +176,7 @@ class UserPluginManager { /** * Count the number of users - * @return int|bool + * @return int|false * @throws \Exception */ public function countUsers() { diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php index 5a445100052..036ddaa9af4 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -45,10 +45,10 @@ use OCA\User_LDAP\Exceptions\NotOnLDAP; use OCA\User_LDAP\User\OfflineUser; use OCA\User_LDAP\User\User; use OCP\IConfig; +use OCP\IUserBackend; use OCP\IUserSession; use OCP\Notification\IManager as INotificationManager; use OCP\User\Backend\ICountUsersBackend; -use OCP\IUserBackend; use OCP\UserInterface; use Psr\Log\LoggerInterface; @@ -581,7 +581,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I /** * counts the users in LDAP * - * @return int|bool + * @return int|false */ public function countUsers() { if ($this->userPluginManager->implementsActions(Backend::COUNT_USERS)) { diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php index 3e2d196e800..8b194f250b4 100644 --- a/apps/user_ldap/lib/User_Proxy.php +++ b/apps/user_ldap/lib/User_Proxy.php @@ -376,7 +376,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface, /** * Count the number of users * - * @return int|bool + * @return int|false */ public function countUsers() { $this->setup(); @@ -385,7 +385,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface, foreach ($this->backends as $backend) { $backendUsers = $backend->countUsers(); if ($backendUsers !== false) { - $users += $backendUsers; + $users = (int)$users + $backendUsers; } } return $users; |