public function addConnection(Base $connection = null, $name = '')
    {
        if($connection instanceof Base)
        {
            if($name !== '')
            {
                $this->connections[$name] = $connection;
            }else{
                $this->connections[] = $connection;
            }
        }else{
            throw new CapsuleInstanceException(sprintf('Connection variable must be a instance of %s', Base::class));
        }
    }
public function addConnection(Base $connection = null, $name = '')
    {
        if($connection instanceof Base)
        {
            if($name !== '')
            {
                $this->connections[$name] = $connection;
            }else{
                $this->connections[] = $connection;
            }
        }else{
            throw new CapsuleInstanceException(sprintf('Connection variable must be a instance of %s', Base::class));
        }
    }
public function addConnection ( Base $ connection = null , $ name = '' ) { if ( $ connection instanceof Base ) { if ( $ name !== '' ) { $ this -> connections [ $ name ] = $ connection ; } else { $ this -> connections [ ] = $ connection ; } } else { throw new CapsuleInstanceException ( sprintf ( 'Connection variable must be a instance of %s' , Base :: class ) ) ; } }
add a connection to capsule

@param Base $connection
@param string $name
@throws CapsuleInstanceException
add a connection to capsule