From 5d8d856056a8239c7cbffba44af1233c4904762f Mon Sep 17 00:00:00 2001 From: Steve Bauman Date: Wed, 8 Nov 2023 15:57:03 -0500 Subject: [PATCH] Remove unnecessary variable --- src/Query/Builder.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Query/Builder.php b/src/Query/Builder.php index bfaad050..b336910f 100644 --- a/src/Query/Builder.php +++ b/src/Query/Builder.php @@ -1402,11 +1402,9 @@ public function insertAndGetDn(string $dn, array $attributes): string|false ); } - $successful = $this->connection->run( + return $this->connection->run( fn (LdapInterface $ldap) => $ldap->add($dn, $attributes) - ); - - return $successful ? $dn : false; + ) ? $dn : false; } /** @@ -1474,11 +1472,9 @@ public function renameAndGetDn(string $dn, string $rdn, string $newParentDn, boo { $newParentDn = $this->substituteBaseDn($newParentDn); - $successful = $this->connection->run( + return $this->connection->run( fn (LdapInterface $ldap) => $ldap->rename($dn, $rdn, $newParentDn, $deleteOldRdn) - ); - - return $successful ? implode(',', [$rdn, $newParentDn]) : false; + ) ? implode(',', [$rdn, $newParentDn]) : false; } /**