src/Money.php
public static function create(BigNumber $amount, Currency $currency, Context $context, int $roundingMode = RoundingMode::UNNECESSARY) : Money
    {
        $amount = $context->applyTo($amount, $currency, $roundingMode);

        return new Money($amount, $currency, $context);
    }
public static function create(BigNumber $amount, Currency $currency, Context $context, int $roundingMode = RoundingMode::UNNECESSARY) : Money
    {
        $amount = $context->applyTo($amount, $currency, $roundingMode);

        return new Money($amount, $currency, $context);
    }
public static function create ( BigNumber $ amount , Currency $ currency , Context $ context , int $ roundingMode = RoundingMode :: UNNECESSARY ) : Money { $ amount = $ context -> applyTo ( $ amount , $ currency , $ roundingMode ) ; return new Money ( $ amount , $ currency , $ context ) ; }
Creates a Money from a rational amount, a currency, and a context.

@param BigNumber $amount       The amount.
@param Currency  $currency     The currency.
@param Context   $context      The context.
@param int       $roundingMode An optional rounding mode if the amount does not fit the context.

@return Money

@throws RoundingNecessaryException If RoundingMode::UNNECESSARY is used but rounding is necessary.
Creates a Money from a rational amount a currency and a context .