src/Shell/Task/SyncLdapGroupsTask.php
protected function getDomain(array $config): string
    {
        $result = '';
        $parts = explode(',', $config['baseDn']);
        foreach ($parts as $part) {
            list($key, $value) = explode('=', $part);
            if ('dc' !== strtolower($key)) {
                continue;
            }

            $result .= '.' . $value;
        }

        $result = trim(trim($result, '.'));

        // fallback value
        if (empty($result)) {
            $result = $config['domain'] . '.com';
        }

        return $result;
    }
protected function getDomain(array $config): string
    {
        $result = '';
        $parts = explode(',', $config['baseDn']);
        foreach ($parts as $part) {
            list($key, $value) = explode('=', $part);
            if ('dc' !== strtolower($key)) {
                continue;
            }

            $result .= '.' . $value;
        }

        $result = trim(trim($result, '.'));

        // fallback value
        if (empty($result)) {
            $result = $config['domain'] . '.com';
        }

        return $result;
    }
protected function getDomain ( array $ config ) : string { $ result = '' ; $ parts = explode ( ',' , $ config [ 'baseDn' ] ) ; foreach ( $ parts as $ part ) { list ( $ key , $ value ) = explode ( '=' , $ part ) ; if ( 'dc' !== strtolower ( $ key ) ) { continue ; } $ result .= '.' . $ value ; } $ result = trim ( trim ( $ result , '.' ) ) ; // fallback value if ( empty ( $ result ) ) { $ result = $ config [ 'domain' ] . '.com' ; } return $ result ; }
Get LDAP domain.

@param mixed[] $config LDAP configuration
@return string
Get LDAP domain .