Bridge/MongoDB/ConnectionFactory.php
public function addConnection(string $name = null, Connection $connection = null): self
    {
        if (is_null($name)) {
            $this->defaultConnection = $connection;
        } else {
            $this->registry[$name] = $connection;
        }

        return $this;
    }
public function addConnection(string $name = null, Connection $connection = null): self
    {
        if (is_null($name)) {
            $this->defaultConnection = $connection;
        } else {
            $this->registry[$name] = $connection;
        }

        return $this;
    }
public function addConnection ( string $ name = null , Connection $ connection = null ) : self { if ( is_null ( $ name ) ) { $ this -> defaultConnection = $ connection ; } else { $ this -> registry [ $ name ] = $ connection ; } return $ this ; }
Adds a connection

@param string     $name
@param Connection $connection

@return ConnectionFactory
Adds a connection