protected function getConnectionString($hosts, $protocol, $port)
    {
        // Normalize hosts into an array.
        $hosts = is_array($hosts) ? $hosts : [$hosts];

        $hosts = array_map(function ($host) use ($protocol, $port) {
            return "{$protocol}{$host}:{$port}";
        }, $hosts);

        return implode(' ', $hosts);
    }
protected function getConnectionString($hosts, $protocol, $port)
    {
        // Normalize hosts into an array.
        $hosts = is_array($hosts) ? $hosts : [$hosts];

        $hosts = array_map(function ($host) use ($protocol, $port) {
            return "{$protocol}{$host}:{$port}";
        }, $hosts);

        return implode(' ', $hosts);
    }
protected function getConnectionString ( $ hosts , $ protocol , $ port ) { // Normalize hosts into an array. $ hosts = is_array ( $ hosts ) ? $ hosts : [ $ hosts ] ; $ hosts = array_map ( function ( $ host ) use ( $ protocol , $ port ) { return "{$protocol}{$host}:{$port}" ; } , $ hosts ) ; return implode ( ' ' , $ hosts ) ; }
Generates an LDAP connection string for each host given.

@param string|array  $hosts
@param string        $protocol
@param string        $port

@return string
Generates an LDAP connection string for each host given .