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; } /**