Merge pull request #1 from civicrm/master
[civicrm-core.git] / CRM / Core / BAO / Country.php
index 632b46de05b29a2652bc82df22f6298f3b0a487d..f6059a6debcef80390753e816ba2de557e3c0d9d 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  * $Id$
  *
  */
@@ -47,7 +47,7 @@ class CRM_Core_BAO_Country extends CRM_Core_DAO_Country {
     if (!isset(Civi::$statics[__CLASS__]['provinceLimit'])) {
       $countryIsoCodes = CRM_Core_PseudoConstant::countryIsoCode();
       $provinceLimit = Civi::settings()->get('provinceLimit');
-      $country = array();
+      $country = [];
       if (is_array($provinceLimit)) {
         foreach ($provinceLimit as $val) {
           // CRM-12007
@@ -74,7 +74,7 @@ class CRM_Core_BAO_Country extends CRM_Core_DAO_Country {
   public static function countryLimit() {
     if (!isset(Civi::$statics[__CLASS__]['countryLimit'])) {
       $countryIsoCodes = CRM_Core_PseudoConstant::countryIsoCode();
-      $country = array();
+      $country = [];
       $countryLimit = Civi::settings()->get('countryLimit');
       if (is_array($countryLimit)) {
         foreach ($countryLimit as $val) {
@@ -139,10 +139,10 @@ class CRM_Core_BAO_Country extends CRM_Core_DAO_Country {
     if (!$cachedSymbol || $defaultCurrency) {
       $currency = $defaultCurrency ? $defaultCurrency : Civi::settings()->get('defaultCurrency');
       if ($currency) {
-        $currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array(
+        $currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', [
           'labelColumn' => 'symbol',
           'orderColumn' => TRUE,
-        ));
+        ]);
         $cachedSymbol = CRM_Utils_Array::value($currency, $currencySymbols, '');
       }
       else {
@@ -160,8 +160,7 @@ class CRM_Core_BAO_Country extends CRM_Core_DAO_Country {
    * @return string
    */
   public static function getDefaultCurrencySymbol($k = NULL) {
-    $config = CRM_Core_Config::singleton();
-    return $config->defaultCurrencySymbol(Civi::settings()->get('defaultCurrency'));
+    return CRM_Core_BAO_Country::defaultCurrencySymbol(\Civi::settings()->get('defaultCurrency'));
   }
 
 }