From b0938b90839503fed01924d4a7874482caf2fc80 Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Fri, 2 Jun 2023 15:26:55 +0330 Subject: Refactors "strpos" calls in /apps/user_ldap to improve code readability. Signed-off-by: Faraz Samapoor --- apps/user_ldap/tests/Group_LDAPTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/user_ldap/tests/Group_LDAPTest.php') 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) { -- cgit v1.2.3