public function reduce(MoneyInterface $source, $toCurrency = null)
    {
        if (null === $toCurrency) {
            $toCurrency = $this->getBaseCurrency();
        }

        $this->checkCurrencies($toCurrency);

        return $source->reduce($this, $toCurrency);
    }
public function reduce(MoneyInterface $source, $toCurrency = null)
    {
        if (null === $toCurrency) {
            $toCurrency = $this->getBaseCurrency();
        }

        $this->checkCurrencies($toCurrency);

        return $source->reduce($this, $toCurrency);
    }
public function reduce ( MoneyInterface $ source , $ toCurrency = null ) { if ( null === $ toCurrency ) { $ toCurrency = $ this -> getBaseCurrency ( ) ; } $ this -> checkCurrencies ( $ toCurrency ) ; return $ source -> reduce ( $ this , $ toCurrency ) ; }
Reduces the supplied monetary object into a single
Money object of the supplied currency.

@param \Dough\Money\MoneyInterface $source
@param string|null $toCurrency

@return Money

@throws \Dough\Exception\InvalidCurrencyException when a supplied currency is
unknown.
Reduces the supplied monetary object into a single Money object of the supplied currency .