diff options
author | Faraz Samapoor <f.samapoor@gmail.com> | 2023-06-02 15:26:55 +0330 |
---|---|---|
committer | Faraz Samapoor <f.samapoor@gmail.com> | 2023-06-02 15:26:55 +0330 |
commit | b0938b90839503fed01924d4a7874482caf2fc80 (patch) | |
tree | 6704ccb6066e29813fd164111e46b896036d65d5 /apps/user_ldap/tests/Group_LDAPTest.php | |
parent | 09c5f997c6d185d8b23b37a996e7a1130a426d75 (diff) | |
download | nextcloud-server-b0938b90839503fed01924d4a7874482caf2fc80.tar.gz nextcloud-server-b0938b90839503fed01924d4a7874482caf2fc80.zip |
Refactors "strpos" calls in /apps/user_ldap to improve code readability.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Diffstat (limited to 'apps/user_ldap/tests/Group_LDAPTest.php')
-rw-r--r-- | apps/user_ldap/tests/Group_LDAPTest.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php index edcb4be8819..2f7c0b04cdc 100644 --- a/apps/user_ldap/tests/Group_LDAPTest.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -157,8 +157,8 @@ class Group_LDAPTest extends TestCase { //to analyze the "dn". All other times we just need to return //something that is neither null or false, but once an array //with the users in the group – so we do so all other times for - //simplicicity. - if (strpos($name, 'u') === 0) { + //simplicity. + if (str_starts_with($name, 'u')) { return strpos($name, '3'); } return ['u11', 'u22', 'u33', 'u34']; @@ -1009,7 +1009,7 @@ class Group_LDAPTest extends TestCase { if (!$nestedGroups) { // When nested groups are enabled, groups cannot be filtered early as it would // exclude intermediate groups. But we can, and should, when working with flat groups. - $this->assertTrue(strpos($filter, $groupFilter) !== false); + $this->assertTrue(str_contains($filter, $groupFilter)); } [$memberFilter] = explode('&', $filter); if ($memberFilter === 'member='.$dn) { |