summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-04-27 11:37:36 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-09-05 16:56:48 +0200
commita5fa1e7715b31a804af56637a82e5717910c8e3f (patch)
treefafbf53e16f2bb8ac52e5b3ea2354e8c5ba1fbb0 /apps
parent3270b7f12ed4efd46bdc8c5bd2d176f1f3547471 (diff)
downloadnextcloud-server-a5fa1e7715b31a804af56637a82e5717910c8e3f.tar.gz
nextcloud-server-a5fa1e7715b31a804af56637a82e5717910c8e3f.zip
Fix psalm errors about groupExists return type
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/lib/Group_Proxy.php12
-rw-r--r--apps/user_ldap/lib/Proxy.php2
2 files changed, 5 insertions, 9 deletions
diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index 3556be8d125..43997a09892 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -325,14 +325,10 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
* {@inheritdoc}
*/
public function groupsExists(array $gids): array {
- $existingGroups = [];
- foreach ($gids as $gid) {
- $exists = $this->handleRequest($gid, 'groupExists', [$gid]);
- if ($exists) {
- $existingGroups[$gid] = $gid;
- }
- }
- return $existingGroups;
+ return array_values(array_filter(
+ $gids,
+ fn (string $gid): bool => $this->handleRequest($gid, 'groupExists', [$gid]),
+ ));
}
/**
diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php
index 8cdb1b1da6a..e2e33f3007b 100644
--- a/apps/user_ldap/lib/Proxy.php
+++ b/apps/user_ldap/lib/Proxy.php
@@ -130,7 +130,7 @@ abstract class Proxy {
* @param string $method string, the method of the user backend that shall be called
* @param array $parameters an array of parameters to be passed
* @param bool $passOnWhen
- * @return mixed, the result of the specified method
+ * @return mixed the result of the specified method
*/
protected function handleRequest($id, $method, $parameters, $passOnWhen = false) {
if (!$this->isSingleBackend()) {