/** * Destructor. * * Closes the current LDAP connection if it exists. */ public function __destruct() { if ($this->ldapConnection instanceof ConnectionInterface) { $this->ldapConnection->close(); } }