X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FMoney.php;h=5a50a8e551f2d1437134ffeb7de5641546373880;hb=f299f7db79fed6f3598c84302966bda087e7cac3;hp=6f95398353c35d77237f909bb1234016438b9fd4;hpb=887f7812c9ac3bbf3c9545c0435e6f9f245ff298;p=civicrm-core.git diff --git a/CRM/Utils/Money.php b/CRM/Utils/Money.php index 6f95398353..5a50a8e551 100644 --- a/CRM/Utils/Money.php +++ b/CRM/Utils/Money.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2019 | + | Copyright CiviCRM LLC (c) 2004-2020 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,14 +28,14 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2019 + * @copyright CiviCRM LLC (c) 2004-2020 */ /** * Money utilties */ class CRM_Utils_Money { - static $_currencySymbols = NULL; + public static $_currencySymbols = NULL; /** * Format a monetary string. @@ -86,10 +86,10 @@ class CRM_Utils_Money { } if (!self::$_currencySymbols) { - self::$_currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array( - 'keyColumn' => 'name', - 'labelColumn' => 'symbol', - )); + self::$_currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', [ + 'keyColumn' => 'name', + 'labelColumn' => 'symbol', + ]); } if (!$currency) { @@ -111,11 +111,11 @@ class CRM_Utils_Money { $amount = self::replaceCurrencySeparators($amount); } - $replacements = array( + $replacements = [ '%a' => $amount, '%C' => $currency, '%c' => CRM_Utils_Array::value($currency, self::$_currencySymbols, $currency), - ); + ]; return strtr($format, $replacements); } @@ -250,10 +250,10 @@ class CRM_Utils_Money { */ protected static function replaceCurrencySeparators($amount) { $config = CRM_Core_Config::singleton(); - $rep = array( + $rep = [ ',' => $config->monetaryThousandSeparator, '.' => $config->monetaryDecimalPoint, - ); + ]; return strtr($amount, $rep); }