src/MoneyComparator.php
public function max(Money $money, Money ...$monies) : Money
    {
        $max = $money;

        foreach ($monies as $money) {
            if ($this->isLess($max, $money)) {
                $max = $money;
            }
        }

        return $max;
    }
public function max(Money $money, Money ...$monies) : Money
    {
        $max = $money;

        foreach ($monies as $money) {
            if ($this->isLess($max, $money)) {
                $max = $money;
            }
        }

        return $max;
    }
public function max ( Money $ money , Money ... $ monies ) : Money { $ max = $ money ; foreach ( $ monies as $ money ) { if ( $ this -> isLess ( $ max , $ money ) ) { $ max = $ money ; } } return $ max ; }
Returns the largest of the given monies.

The monies are compared from left to right. This distinction can be important if the exchange rate provider does
not have bidirectional exchange rates, or applies different rates depending on the direction of the conversion.

For example, when comparing [A, B, C], this method will first compare A against B, then max(A,B) against C.

If several monies are equal to the maximum value, the first one is returned.

@param Money    $money  The first money.
@param Money ...$monies The subsequent monies.

@return Money The largest Money.

@throws CurrencyConversionException If an exchange rate is not available.
Returns the largest of the given monies .