]> source.dussan.org Git - nextcloud-server.git/commitdiff
use break not continue in switch to avoid warning 22175/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 10 Aug 2020 15:34:11 +0000 (17:34 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 10 Aug 2020 15:34:11 +0000 (17:34 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/user_ldap/lib/Group_LDAP.php

index 199865e7623981e372f0251c1fc6a9b3041db8fb..6bf1bd31ba04df84c23d7f28f247f6410643ef98 100644 (file)
@@ -877,8 +877,8 @@ class Group_LDAP extends BackendUtility implements GroupInterface, IGroupLDAP, I
                                                ])
                                        ]);
                                        $ldap_users = $this->access->fetchListOfUsers($filter, $attrs, 1);
-                                       if (count($ldap_users) < 1) {
-                                               continue;
+                                       if (empty($ldap_users)) {
+                                               break;
                                        }
                                        $groupUsers[] = $this->access->dn2username($ldap_users[0]['dn'][0]);
                                        break;
@@ -886,13 +886,13 @@ class Group_LDAP extends BackendUtility implements GroupInterface, IGroupLDAP, I
                                        //we got DNs, check if we need to filter by search or we can give back all of them
                                        $uid = $this->access->dn2username($member);
                                        if (!$uid) {
-                                               continue;
+                                               break;
                                        }
 
                                        $cacheKey = 'userExistsOnLDAP' . $uid;
                                        $userExists = $this->access->connection->getFromCache($cacheKey);
                                        if ($userExists === false) {
-                                               continue;
+                                               break;
                                        }
                                        if ($userExists === null || $search !== '') {
                                                if (!$this->access->readAttribute($member,
@@ -904,7 +904,7 @@ class Group_LDAP extends BackendUtility implements GroupInterface, IGroupLDAP, I
                                                        if ($search === '') {
                                                                $this->access->connection->writeToCache($cacheKey, false);
                                                        }
-                                                       continue;
+                                                       break;
                                                }
                                                $this->access->connection->writeToCache($cacheKey, true);
                                        }