src/LdapTools/Operation/Invoker/LdapOperationInvoker.php
protected function switchServerIfNeeded($currentServer, $wantedServer, LdapOperationInterface $operation)
    {
        if ($operation instanceof AuthenticationOperation || MBString::strtolower($currentServer) == MBString::strtolower($wantedServer)) {
            return;
        }
        if ($this->connection->isBound()) {
            $this->connection->close();
        }
        $this->connection->connect(null, null, false, $wantedServer);
    }
protected function switchServerIfNeeded($currentServer, $wantedServer, LdapOperationInterface $operation)
    {
        if ($operation instanceof AuthenticationOperation || MBString::strtolower($currentServer) == MBString::strtolower($wantedServer)) {
            return;
        }
        if ($this->connection->isBound()) {
            $this->connection->close();
        }
        $this->connection->connect(null, null, false, $wantedServer);
    }
protected function switchServerIfNeeded ( $ currentServer , $ wantedServer , LdapOperationInterface $ operation ) { if ( $ operation instanceof AuthenticationOperation || MBString :: strtolower ( $ currentServer ) == MBString :: strtolower ( $ wantedServer ) ) { return ; } if ( $ this -> connection -> isBound ( ) ) { $ this -> connection -> close ( ) ; } $ this -> connection -> connect ( null , null , false , $ wantedServer ) ; }
Performs the logic for switching the LDAP server connection.

@param string|null $currentServer The server we are currently on.
@param string|null $wantedServer The server we want the connection to be on.
@param LdapOperationInterface $operation
Performs the logic for switching the LDAP server connection .