Merge pull request #5086 from deepak-srivastava/CRM-15490
[civicrm-core.git] / CRM / Price / BAO / LineItem.php
index e9a0a73db69690772486df4b475408cc015ce26b..f056ed78a7e38bbab2d907fd71e78cfb52b28c50 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -84,10 +84,9 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem {
   }
 
   /**
-   * Takes a bunch of params that are needed to match certain criteria and
-   * retrieves the relevant objects.  Typically, the valid params are only
-   * price_field_id.  This is the inverse function of create.  It also
-   * stores all of the retrieved values in the default array.
+   * Retrieve DB object based on input parameters.
+   *
+   * It also stores all the retrieved values in the default array.
    *
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
@@ -123,7 +122,7 @@ AND li.entity_id = {$entityId}
   }
 
   /**
-   * Wrapper for line item retrieval when contribution ID is known
+   * Wrapper for line item retrieval when contribution ID is known.
    * @param int $contributionID
    *
    * @return array
@@ -530,18 +529,17 @@ AND li.entity_id = {$entityId}
   }
 
   /**
-   * Calculate tax rate in percentage
+   * Calculate tax rate in percentage.
    *
    * @param array $lineItemId
    *   An assoc array of lineItem.
    *
-   * @return number|void
+   * @return int|void
    *   tax rate
-   *
    */
   public static function calculateTaxRate($lineItemId) {
     if ($lineItemId['unit_price'] == 0) {
-      return;
+      return FALSE;
     }
     if ($lineItemId['html_type'] == 'Text') {
       $tax = $lineItemId['tax_amount'] / ($lineItemId['unit_price'] * $lineItemId['qty']) * 100;
@@ -551,4 +549,5 @@ AND li.entity_id = {$entityId}
     }
     return $tax;
   }
+
 }