src/Money/Money.php
public static function withSecure($amount, Currency $currency = null)
    {
        if(!is_long($amount))
            throw new InvalidAmountException;
        $money = self::withRaw(0, $currency);
        $money->setFraction($amount / 100);
        $money->setWhole($amount / 100);
        return $money;
    }
public static function withSecure($amount, Currency $currency = null)
    {
        if(!is_long($amount))
            throw new InvalidAmountException;
        $money = self::withRaw(0, $currency);
        $money->setFraction($amount / 100);
        $money->setWhole($amount / 100);
        return $money;
    }
public static function withSecure ( $ amount , Currency $ currency = null ) { if ( ! is_long ( $ amount ) ) throw new InvalidAmountException ; $ money = self :: withRaw ( 0 , $ currency ) ; $ money -> setFraction ( $ amount / 100 ) ; $ money -> setWhole ( $ amount / 100 ) ; return $ money ; }
Creates a money instance using a complete
integer value for both the whole part
and the fractional part

@param $amount
@param Currency|null $currency

@return Money
@throws InvalidAmountException
Creates a money instance using a complete integer value for both the whole part and the fractional part