public static function map($scheme = null, $adapter = null)
    {
        if (is_array($scheme)) {
            foreach ($scheme as $s => $adapter) {
                static::map($s, $adapter);
            }
            return static::$adapterMap;
        }

        if ($scheme === null) {
            return static::$adapterMap;
        }

        if ($adapter === null) {
            return isset(static::$adapterMap[$scheme]) ? static::$adapterMap[$scheme] : null;
        }

        if ($adapter === false) {
            unset($adapterMap[$scheme]);
            return;
        }

        return static::$adapterMap[$scheme] = $adapter;
    }
public static function map($scheme = null, $adapter = null)
    {
        if (is_array($scheme)) {
            foreach ($scheme as $s => $adapter) {
                static::map($s, $adapter);
            }
            return static::$adapterMap;
        }

        if ($scheme === null) {
            return static::$adapterMap;
        }

        if ($adapter === null) {
            return isset(static::$adapterMap[$scheme]) ? static::$adapterMap[$scheme] : null;
        }

        if ($adapter === false) {
            unset($adapterMap[$scheme]);
            return;
        }

        return static::$adapterMap[$scheme] = $adapter;
    }
public static function map ( $ scheme = null , $ adapter = null ) { if ( is_array ( $ scheme ) ) { foreach ( $ scheme as $ s => $ adapter ) { static :: map ( $ s , $ adapter ) ; } return static :: $ adapterMap ; } if ( $ scheme === null ) { return static :: $ adapterMap ; } if ( $ adapter === null ) { return isset ( static :: $ adapterMap [ $ scheme ] ) ? static :: $ adapterMap [ $ scheme ] : null ; } if ( $ adapter === false ) { unset ( $ adapterMap [ $ scheme ] ) ; return ; } return static :: $ adapterMap [ $ scheme ] = $ adapter ; }
Read or change the adapter map

For example:

$true = Dsn::map('foo', 'UseThisAdapter');
$dsn = Dsn::parse('foo://....');
$dsn->adapter === 'UseThisAdapter';

$array = ['this' => 'That\Class', 'other' => 'Other\Class', ...];
$fullMap = Dsn::map($array);
$dsn = Dsn::parse('this://....');
$dsn->adapter === 'That\Class';
$dsn = Dsn::parse('other://....');
$dsn->adapter === 'Other\Class';

@param mixed $adapter
@param string $class
@return mixed
Read or change the adapter map