Merge pull request #4960 from monishdeb/INFRA-32
[civicrm-core.git] / CRM / Contribute / BAO / Contribution / Utils.php
index 9a4d6124bfbba9a369c3d60dad7cfc8d2c7655ef..75bd26eb26ff3c8dc0e39b9af7e24ca34bd5bcdf 100644 (file)
@@ -41,10 +41,10 @@ class CRM_Contribute_BAO_Contribution_Utils {
    *   Form object.
    * @param array $paymentParams
    *   Array with payment related key.
-   * value pairs
+   *   value pairs
    * @param array $premiumParams
    *   Array with premium related key.
-   * value pairs
+   *   value pairs
    * @param int $contactID
    *   Contact id.
    * @param int $contributionTypeId
@@ -57,11 +57,11 @@ class CRM_Contribute_BAO_Contribution_Utils {
    *
    * @throws CRM_Core_Exception
    * @throws Exception
-   * @return array associated array
+   * @return array
+   *   associated array
    *
-   * @static
    */
-  static function processConfirm(
+  public static function processConfirm(
     &$form,
     &$paymentParams,
     &$premiumParams,
@@ -282,8 +282,8 @@ class CRM_Contribute_BAO_Contribution_Utils {
       if ($component !== 'membership') {
         CRM_Core_Error::displaySessionError($result);
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/transact',
-            "_qf_Main_display=true&qfKey={$form->_params['qfKey']}"
-          ));
+          "_qf_Main_display=true&qfKey={$form->_params['qfKey']}"
+        ));
       }
       $membershipResult[1] = $result;
     }
@@ -353,7 +353,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
       $form->_values['contribution_id'] = $contribution->id;
       CRM_Contribute_BAO_ContributionPage::sendMail($contactID,
         $form->_values, $contribution->is_test,
-      FALSE, $fieldTypes
+        FALSE, $fieldTypes
       );
     }
   }
@@ -373,6 +373,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
     return FALSE;
 
   }
+
   /**
    * Get the contribution details by month
    * of the year
@@ -380,9 +381,9 @@ class CRM_Contribute_BAO_Contribution_Utils {
    * @param int $param
    *   Year.
    *
-   * @return array associated array
+   * @return array
+   *   associated array
    *
-   * @static
    */
   public static function contributionChartMonthly($param) {
     if ($param) {
@@ -420,9 +421,9 @@ INNER JOIN   civicrm_contact AS contact ON ( contact.id = contrib.contact_id )
   /**
    * Get the contribution details by year
    *
-   * @return array associated array
+   * @return array
+   *   associated array
    *
-   * @static
    */
   public static function contributionChartYearly() {
     $config = CRM_Core_Config::singleton();
@@ -508,9 +509,10 @@ INNER JOIN   civicrm_contact contact ON ( contact.id = contrib.contact_id )
     if (!CRM_Utils_System::isNull($params['email'])) {
       $params['email'] = array(
         1 => array(
-      'email' => $params['email'],
+          'email' => $params['email'],
           'location_type_id' => $billingLocTypeId,
-        ));
+        ),
+      );
     }
 
     if (isset($transaction['trxn_id'])) {
@@ -564,7 +566,11 @@ INNER JOIN   civicrm_contact contact ON ( contact.id = contrib.contact_id )
     $type = strtolower($type);
 
     if (!in_array($type, array(
-      'paypal', 'google', 'csv'))) {
+      'paypal',
+      'google',
+      'csv',
+    ))
+    ) {
       // return the params as is
       return $apiParams;
     }
@@ -800,10 +806,10 @@ INNER JOIN   civicrm_contact contact ON ( contact.id = contrib.contact_id )
     // if this is a recurring contribution then process it first
     if ($params['trxn_type'] == 'subscrpayment') {
       // see if a recurring record already exists
-      $recurring = new CRM_Contribute_BAO_ContributionRecur;
+      $recurring = new CRM_Contribute_BAO_ContributionRecur();
       $recurring->processor_id = $params['processor_id'];
       if (!$recurring->find(TRUE)) {
-        $recurring = new CRM_Contribute_BAO_ContributionRecur;
+        $recurring = new CRM_Contribute_BAO_ContributionRecur();
         $recurring->invoice_id = $params['invoice_id'];
         $recurring->find(TRUE);
       }
@@ -893,9 +899,8 @@ LIMIT 1
    * @param float $taxRate
    *   Tax rate of selected financial account for field.
    *
-   * @return array array of tax amount
-   *
-   * @static
+   * @return array
+   *   array of tax amount
    *
    */
   public static function calculateTaxAmount($amount, $taxRate) {