Merge pull request #6170 from colemanw/CRM-16354
[civicrm-core.git] / CRM / Utils / Money.php
index 105e092d88abd7e4f7e261b639c1f33382d08b47..1d15662f6f84039b9a1bfda5f21e3145bcc279b2 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -40,7 +40,7 @@ class CRM_Utils_Money {
   static $_currencySymbols = NULL;
 
   /**
-   * Format a monetary string
+   * Format a monetary string.
    *
    * Format a monetary string basing on the amount provided,
    * ISO currency code provided and a format string consisting of:
@@ -49,15 +49,19 @@ class CRM_Utils_Money {
    * %C - the currency ISO code (e.g., 'USD') if provided
    * %c - the currency symbol (e.g., '$') if available
    *
-   * @param float $amount the monetary amount to display (1234.56)
-   * @param string $currency the three-letter ISO currency code ('USD')
-   * @param string $format the desired currency format
+   * @param float $amount
+   *   The monetary amount to display (1234.56).
+   * @param string $currency
+   *   The three-letter ISO currency code ('USD').
+   * @param string $format
+   *   The desired currency format.
    * @param bool $onlyNumber
-   * @param string $valueFormat the desired monetary value display format (e.g. '%!i')
+   * @param string $valueFormat
+   *   The desired monetary value display format (e.g. '%!i').
    *
-   * @return string  formatted monetary string
+   * @return string
+   *   formatted monetary string
    *
-   * @static
    */
   public static function format($amount, $currency = NULL, $format = NULL, $onlyNumber = FALSE, $valueFormat = NULL) {
 
@@ -84,7 +88,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', array(
+          'keyColumn' => 'name',
+          'labelColumn' => 'symbol',
+        ));
     }
 
     if (!$currency) {
@@ -119,5 +126,5 @@ class CRM_Utils_Money {
     );
     return strtr($format, $replacements);
   }
-}
 
+}