EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
currency value object support int
Yuri Kuznetsov3608af3836bb
diff --git a/application/Espo/Core/Field/Currency.php b/application/Espo/Core/Field/Currency.phpindex b5d733b10d..21e271b55b 100644--- a/application/Espo/Core/Field/Currency.php+++ b/application/Espo/Core/Field/Currency.php@@ -44,13 +44,13 @@ class Currencyprivate string $code;/**- * @param numeric-string|float $amount An amount.+ * @param numeric-string|float|int $amount An amount.* @param string $code A currency code.* @throws RuntimeException*/public function __construct($amount, string $code){- if (!is_string($amount) && !is_float($amount)) {+ if (!is_string($amount) && !is_float($amount) && !is_int($amount)) {throw new InvalidArgumentException();}@@ -58,7 +58,7 @@ class Currencythrow new RuntimeException("Bad currency code.");}- if (is_float($amount)) {+ if (is_float($amount) || is_int($amount)) {$amount = (string) $amount;}@@ -197,7 +197,7 @@ class Currency/*** Create from an amount and code.*- * @param numeric-string|float $amount An amount.+ * @param numeric-string|float|int $amount An amount.* @param string $code A currency code.* @throws RuntimeException*/