(NFC) update CRM/Contribute to be the new coder standard
authorSeamus Lee <seamuslee001@gmail.com>
Wed, 10 Apr 2019 20:33:50 +0000 (06:33 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 10 Apr 2019 21:13:12 +0000 (07:13 +1000)
58 files changed:
CRM/Contribute/ActionMapping/ByPage.php
CRM/Contribute/ActionMapping/ByType.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/BAO/ContributionRecur.php
CRM/Contribute/BAO/Product.php
CRM/Contribute/BAO/Query.php
CRM/Contribute/BAO/Widget.php
CRM/Contribute/Form/AbstractEditPayment.php
CRM/Contribute/Form/AdditionalPayment.php
CRM/Contribute/Form/CancelSubscription.php
CRM/Contribute/Form/Contribution.php
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Contribute/Form/Contribution/Main.php
CRM/Contribute/Form/Contribution/ThankYou.php
CRM/Contribute/Form/ContributionBase.php
CRM/Contribute/Form/ContributionCharts.php
CRM/Contribute/Form/ContributionPage.php
CRM/Contribute/Form/ContributionPage/AddProduct.php
CRM/Contribute/Form/ContributionPage/Amount.php
CRM/Contribute/Form/ContributionPage/Delete.php
CRM/Contribute/Form/ContributionPage/Settings.php
CRM/Contribute/Form/ContributionPage/TabHeader.php
CRM/Contribute/Form/ContributionView.php
CRM/Contribute/Form/ManagePremiums.php
CRM/Contribute/Form/Search.php
CRM/Contribute/Form/SoftCredit.php
CRM/Contribute/Form/Task.php
CRM/Contribute/Form/Task/Batch.php
CRM/Contribute/Form/Task/Delete.php
CRM/Contribute/Form/Task/Invoice.php
CRM/Contribute/Form/Task/PDF.php
CRM/Contribute/Form/Task/PDFLetter.php
CRM/Contribute/Form/Task/PDFLetterCommon.php
CRM/Contribute/Form/Task/PickProfile.php
CRM/Contribute/Form/Task/Print.php
CRM/Contribute/Form/Task/Result.php
CRM/Contribute/Form/Task/SearchTaskHookSample.php
CRM/Contribute/Form/Task/Status.php
CRM/Contribute/Form/UpdateBilling.php
CRM/Contribute/Form/UpdateSubscription.php
CRM/Contribute/Import/Field.php
CRM/Contribute/Import/Form/MapField.php
CRM/Contribute/Import/Parser.php
CRM/Contribute/Import/Parser/Contribution.php
CRM/Contribute/Info.php
CRM/Contribute/Page/AJAX.php
CRM/Contribute/Page/ContributionPage.php
CRM/Contribute/Page/ContributionRecur.php
CRM/Contribute/Page/DashBoard.php
CRM/Contribute/Page/ManagePremiums.php
CRM/Contribute/Page/PaymentInfo.php
CRM/Contribute/Page/Tab.php
CRM/Contribute/Selector/Search.php
CRM/Contribute/StateMachine/Search.php
CRM/Contribute/Task.php
CRM/Contribute/Tokens.php

index 285e7987a708d56a982611d6f081f389e52f6016..5e1d62448bcf1d04be2131d083289fe358d50848 100644 (file)
@@ -25,7 +25,6 @@
  +--------------------------------------------------------------------+
  */
 
-use Civi\ActionSchedule\RecipientBuilder;
 
 /**
  * Class CRM_Contribute_ActionMapping_ByPage
index 8708ef396582e0f82b318fa3d2bcaccfee89f42e..3d4a85c8aeb3d409a6f4385d5f722b96085f733c 100644 (file)
@@ -25,7 +25,6 @@
  +--------------------------------------------------------------------+
  */
 
-use Civi\ActionSchedule\RecipientBuilder;
 
 /**
  * Class CRM_Contribute_ActionMapping_ByType
index 50905b29340beb9e78a3e236a9b8050f961ebcff..48e16a4dbf27fcec5c0434e1df457e5f5a2f5dff 100644 (file)
@@ -37,21 +37,21 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
    *
    * @var array
    */
-  static $_importableFields = NULL;
+  public static $_importableFields = NULL;
 
   /**
    * Static field for all the contribution information that we can potentially export
    *
    * @var array
    */
-  static $_exportableFields = NULL;
+  public static $_exportableFields = NULL;
 
   /**
    * Static field to hold financial trxn id's.
    *
    * @var array
    */
-  static $_trxnIDs = NULL;
+  public static $_trxnIDs = NULL;
 
   /**
    * Field for all the objects related to this contribution
@@ -326,7 +326,8 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
 
       return $contribution;
     }
-    $null = NULL; // return by reference
+    // return by reference
+    $null = NULL;
     return $null;
   }
 
@@ -965,7 +966,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
     // as they would then me membership.contact_id, membership.is_test etc
     return civicrm_api3('Membership', 'get', [
       'id' => ['IN' => $membershipIDs],
-      'return' => ['id', 'contact_id', 'membership_type_id', 'is_test']
+      'return' => ['id', 'contact_id', 'membership_type_id', 'is_test'],
     ])['values'];
   }
 
@@ -990,7 +991,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
     }
     else {
       $whereClauses['financial_type_id'] = [
-        'IN (' . implode(',', array_keys($types)) . ')'
+        'IN (' . implode(',', array_keys($types)) . ')',
       ];
     }
     return $whereClauses;
@@ -1157,7 +1158,7 @@ INNER JOIN  civicrm_contact contact ON ( contact.id = c.contact_id )
       'subject' => ts('Payment failed at payment processor'),
       'source_record_id' => $contributionID,
       'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() :
-        $contactID,
+      $contactID,
     ));
 
     // CRM-20336 Make sure that the contribution status is Failed, not Pending.
@@ -3869,7 +3870,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
     return FALSE;
   }
 
-
   /**
    * Function to record additional payment for partial and refund contributions.
    *
@@ -5139,6 +5139,7 @@ LEFT JOIN  civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co
    *   Line items.
    * @param bool $isARefund
    *   Is this a refund / negative transaction.
+   * @param int $previousLineItemTotal
    *
    * @return float
    */
@@ -5345,9 +5346,10 @@ LIMIT 1;";
    * @param float $balance
    * @param string $contributionStatus
    *
-   * @return array $actionLinks Links array containing:
-   *   -url
-   *   -title
+   * @return array
+   *   $actionLinks Links array containing:
+   *     -url
+   *     -title
    */
   protected static function getContributionPaymentLinks($id, $balance, $contributionStatus) {
     if ($contributionStatus === 'Failed' || !CRM_Core_Permission::check('edit contributions')) {
@@ -5450,7 +5452,7 @@ LIMIT 1;";
 
     $clauses = [];
     foreach ($whereClauses as $key => $clause) {
-      $clauses[] = 'b.' . $key . " "  . implode(' AND b.' . $key, (array) $clause);
+      $clauses[] = 'b.' . $key . " " . implode(' AND b.' . $key, (array) $clause);
     }
     $whereClauseString = implode(' AND ', $clauses);
 
index ebd162952e1f3060b4b0a8cdc202ac61e5da7e66..08c84098c3840bb5c0a96036404da5f71a2078f4 100644 (file)
@@ -120,7 +120,8 @@ class CRM_Contribute_BAO_Contribution_Utils {
             1 => $form->_id,
             2 => $contributionParams['source'],
           ]),
-          220 // eventually activity.description append price information to source text so keep it 220 to ensure string length doesn't exceed 255 characters.
+          // eventually activity.description append price information to source text so keep it 220 to ensure string length doesn't exceed 255 characters.
+          220
         );
       }
 
@@ -251,7 +252,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
    *
    * @return bool
    */
-  static protected function isPaymentTransaction($form) {
+  protected static function isPaymentTransaction($form) {
     return ($form->_amount >= 0.0) ? TRUE : FALSE;
   }
 
@@ -533,7 +534,7 @@ LIMIT 1
    * @param int $id
    *   Contribution ID
    *
-   * @return array $statuses
+   * @return array
    *   Array of contribution statuses in array('status id' => 'label') format
    */
   public static function getContributionStatuses($usedFor = 'contribution', $id = NULL) {
index 10e47c8a902dea8aaaebad85d065c49644103b64..492afdb67c0bc163bd0ce227482b0fb182e0e437 100644 (file)
@@ -974,10 +974,10 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
    */
   public static function getIsMembershipPayment($id) {
     $membershipBlocks = civicrm_api3('membership_block', 'get', [
-        'entity_table' => 'civicrm_contribution_page',
-        'entity_id' => $id,
-        'sequential' => TRUE,
-      ]);
+      'entity_table' => 'civicrm_contribution_page',
+      'entity_id' => $id,
+      'sequential' => TRUE,
+    ]);
     if (!$membershipBlocks['count']) {
       return FALSE;
     }
index 649b361b49d6724a8672a7031d7f105200e8b8b9..51ff736c2fc3fa51a91629453a6af9323732c64f 100644 (file)
@@ -175,7 +175,6 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi
     return CRM_Financial_BAO_PaymentProcessor::getPayment($paymentProcessorID);
   }
 
-
   /**
    * Get the processor object for the recurring contribution record.
    *
@@ -203,7 +202,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi
   public static function getPaymentProcessorID($recurID) {
     $recur = civicrm_api3('ContributionRecur', 'getsingle', [
       'id' => $recurID,
-      'return' => ['payment_processor_id']
+      'return' => ['payment_processor_id'],
     ]);
     return (int) CRM_Utils_Array::value('payment_processor_id', $recur, 0);
   }
@@ -306,10 +305,10 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi
         }
         else {
           $details .= '<br/>' . ts('The recurring contribution of %1, every %2 %3 has been cancelled.', [
-              1 => $dao->amount,
-              2 => $dao->frequency_interval,
-              3 => $dao->frequency_unit,
-            ]);
+            1 => $dao->amount,
+            2 => $dao->frequency_interval,
+            3 => $dao->frequency_unit,
+          ]);
         }
         $activityParams = [
           'source_contact_id' => $dao->contact_id,
@@ -586,7 +585,7 @@ INNER JOIN civicrm_contribution       con ON ( con.id = mp.contribution_id )
    * @param int $recurId
    * @param int $targetContributionId
    */
-  static public function copyCustomValues($recurId, $targetContributionId) {
+  public static function copyCustomValues($recurId, $targetContributionId) {
     if ($recurId && $targetContributionId) {
       // get the initial contribution id of recur id
       $sourceContributionId = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $recurId, 'id', 'contribution_recur_id');
@@ -851,6 +850,7 @@ INNER JOIN civicrm_contribution       con ON ( con.id = mp.contribution_id )
    *   Payment status - this correlates to the machine name of the contribution status ID ie
    *   - Completed
    *   - Failed
+   * @param string $effectiveDate
    *
    * @throws \CiviCRM_API3_Exception
    */
@@ -931,10 +931,10 @@ INNER JOIN civicrm_contribution       con ON ( con.id = mp.contribution_id )
    */
   public static function calculateRecurLineItems($recurId, $total_amount, $financial_type_id) {
     $originalContribution = civicrm_api3('Contribution', 'getsingle', [
-    'contribution_recur_id' => $recurId,
-    'contribution_test' => '',
-    'options' => ['limit' => 1],
-    'return' => ['id', 'financial_type_id'],
+      'contribution_recur_id' => $recurId,
+      'contribution_test' => '',
+      'options' => ['limit' => 1],
+      'return' => ['id', 'financial_type_id'],
     ]);
     $lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($originalContribution['id']);
     $lineSets = [];
index 55915eb270000c10e7fea40d906aca9ca76d29b7..f3505f972cfc907e3951a8a0f7bf24ca9d1a684b 100644 (file)
@@ -34,8 +34,9 @@ class CRM_Contribute_BAO_Product extends CRM_Contribute_DAO_Product {
 
   /**
    * Static holder for the default LT.
+   * @var int
    */
-  static $_defaultContributionType = NULL;
+  public static $_defaultContributionType = NULL;
 
   /**
    * Class constructor.
index d0af3c53fa11d132d0119b593842e7c73f6c4efc..3c51f78c2357ca658d922e1ddc88fcfc8d30c176 100644 (file)
@@ -32,9 +32,9 @@
  */
 class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query {
 
-  static $_contribOrSoftCredit = "only_contribs";
+  public static $_contribOrSoftCredit = "only_contribs";
 
-  static $_contribRecurPayment = NULL;
+  public static $_contribRecurPayment = NULL;
 
   /**
    * Function get the searchable fields for contribution.
@@ -1030,7 +1030,7 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query {
         FALSE, [
           'class' => 'crm-select2',
           'multiple' => 'multiple',
-          'placeholder' => ts('- any -')
+          'placeholder' => ts('- any -'),
         ]
       );
     }
index 78535f2493f25d8db1e42ffd5fd5b67a7c76df16..45ecc4116cf8a89024050c2906b22a52a95ffb55 100644 (file)
@@ -127,14 +127,11 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
         $now = time();
         if ($dao->start_date) {
           $startDate = CRM_Utils_Date::unixTime($dao->start_date);
-          if ($startDate &&
-            $startDate >= $now
-          ) {
+          if ($startDate && $startDate >= $now) {
             $data['is_active'] = FALSE;
             $data['campaign_start'] = ts('Campaign starts on %1', [
-                1 => CRM_Utils_Date::customFormat($dao->start_date, $config->dateformatFull),
-              ]
-            );
+              1 => CRM_Utils_Date::customFormat($dao->start_date, $config->dateformatFull),
+            ]);
           }
         }
 
@@ -180,9 +177,9 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
       $data['money_raised_percentage'] = (round($percent, 2)) * 100 . "%";
       $data['money_target_display'] = CRM_Utils_Money::format($data['money_target']);
       $data['money_raised'] = ts('Raised %1 of %2', [
-          1 => CRM_Utils_Money::format($data['money_raised']),
-          2 => $data['money_target_display'],
-        ]);
+        1 => CRM_Utils_Money::format($data['money_raised']),
+        2 => $data['money_target_display'],
+      ]);
     }
     else {
       $data['money_raised'] = ts('Raised %1', [1 => CRM_Utils_Money::format($data['money_raised'])]);
index 70b4860aed4835f735b0028a1b81eb86f59ee626..1eacda32bb1f0a020852b899f52a7f0e8854c2c4 100644 (file)
@@ -178,11 +178,13 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task {
 
   /**
    * The contribution values if an existing contribution
+   * @var array
    */
   public $_values;
 
   /**
    * The pledge values if this contribution is associated with pledge
+   * @var array
    */
   public $_pledgeValues;
 
@@ -194,6 +196,7 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task {
 
   /**
    * Store the line items if price set used.
+   * @var array
    */
   public $_lineItems;
 
@@ -237,6 +240,7 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task {
    * These should get a standardised format in the beginPostProcess function.
    *
    * These fields are common to many forms. Some may override this.
+   * @var array
    */
   protected $submittableMoneyFields = ['total_amount', 'net_amount', 'non_deductible_amount', 'fee_amount'];
 
@@ -730,11 +734,10 @@ WHERE  contribution_id = {$id}
     }
   }
 
-
   /**
    * Assign the values to build the payment info block.
    *
-   * @return string $title
+   * @return string
    *   Block title.
    */
   protected function assignPaymentInfoBlock() {
index 84c7d7ba77eba7ad1dee0d48a5236d3ac70b8d1a..1c37915b58032459827fece99db4e4a9dd989da2 100644 (file)
@@ -39,6 +39,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
 
   /**
    * Id of the component entity
+   * @var int
    */
   public $_id = NULL;
 
@@ -49,9 +50,8 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
   protected $_refund = NULL;
 
   /**
-   * @deprecated - use parent $this->contactID
-   *
    * @var int
+   * @deprecated - use parent $this->contactID
    */
   protected $_contactId = NULL;
 
@@ -153,6 +153,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
    * @return array
    *   reference to the array of default values
    */
+
   /**
    * @return array
    */
@@ -188,14 +189,13 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
   public function buildQuickForm() {
     if ($this->_view == 'transaction' && ($this->_action & CRM_Core_Action::BROWSE)) {
       $this->addButtons([
-          [
-            'type' => 'cancel',
-            'name' => ts('Done'),
-            'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-            'isDefault' => TRUE,
-          ],
-        ]
-      );
+        [
+          'type' => 'cancel',
+          'name' => ts('Done'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+          'isDefault' => TRUE,
+        ],
+      ]);
       return;
     }
 
@@ -262,18 +262,17 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
 
     $buttonName = $this->_refund ? 'Record Refund' : 'Record Payment';
     $this->addButtons([
-        [
-          'type' => 'upload',
-          'name' => ts('%1', [1 => $buttonName]),
-          'js' => $js,
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'upload',
+        'name' => ts('%1', [1 => $buttonName]),
+        'js' => $js,
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
     $mailingInfo = Civi::settings()->get('mailing_backend');
     $this->assign('outBound_option', $mailingInfo['outBound_option']);
 
index 22896289093f3b66da86f5f1752a3253841882e7..91bbe384604b074ac5a877d044e447e84b12e407 100644 (file)
@@ -152,18 +152,17 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Contribute_Form_Contrib
     }
 
     $this->addButtons([
-        [
-          'type' => $type,
-          'name' => $cancelButton,
-          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Not Now'),
-        ],
-      ]
-    );
+      [
+        'type' => $type,
+        'name' => $cancelButton,
+        'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Not Now'),
+      ],
+    ]);
   }
 
   /**
index f088ade2aa081bfee8ece93e40802f199fdb41ad..ab46198a0b7aaf84a2e5be3730a4790a9cc0dbcc 100644 (file)
@@ -102,11 +102,13 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
 
   /**
    * The contribution values if an existing contribution
+   * @var array
    */
   public $_values;
 
   /**
    * The pledge values if this contribution is associated with pledge
+   * @var array
    */
   public $_pledgeValues;
 
@@ -116,8 +118,8 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
 
   /**
    * Parameter with confusing name.
-   * @todo what is it?
    * @var string
+   * @todo what is it?
    */
   public $_compContext;
 
@@ -137,13 +139,14 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
 
   /**
    * Store the line items if price set used.
+   * @var array
    */
   public $_lineItems;
 
   /**
    * Line item
-   * @todo explain why we use lineItem & lineItems
    * @var array
+   * @todo explain why we use lineItem & lineItems
    */
   public $_lineItem;
 
@@ -461,18 +464,17 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
   public function buildQuickForm() {
     if ($this->_action & CRM_Core_Action::DELETE) {
       $this->addButtons([
-          [
-            'type' => 'next',
-            'name' => ts('Delete'),
-            'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-            'isDefault' => TRUE,
-          ],
-          [
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ],
-        ]
-      );
+        [
+          'type' => 'next',
+          'name' => ts('Delete'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+          'isDefault' => TRUE,
+        ],
+        [
+          'type' => 'cancel',
+          'name' => ts('Cancel'),
+        ],
+      ]);
       return;
     }
 
@@ -613,9 +615,9 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
 
     if ($this->_context == 'standalone') {
       $this->addEntityRef('contact_id', ts('Contact'), [
-          'create' => TRUE,
-          'api' => ['extra' => ['email']],
-        ], TRUE);
+        'create' => TRUE,
+        'api' => ['extra' => ['email']],
+      ], TRUE);
     }
 
     $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution');
@@ -798,24 +800,23 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
     $this->assign('outBound_option', $mailingInfo['outBound_option']);
 
     $this->addButtons([
-        [
-          'type' => 'upload',
-          'name' => ts('Save'),
-          'js' => $js,
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'upload',
-          'name' => ts('Save and New'),
-          'js' => $js,
-          'subName' => 'new',
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'upload',
+        'name' => ts('Save'),
+        'js' => $js,
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'upload',
+        'name' => ts('Save and New'),
+        'js' => $js,
+        'subName' => 'new',
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
 
     // if contribution is related to membership or participant freeze Financial Type, Amount
     if ($this->_id) {
index d597b15ece67c54fb713faa9422dd04bced97ae7..9add6a4ec12fc172b89cf6f7ee609fabdc9aa145 100644 (file)
@@ -455,10 +455,10 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
       // no on behalf of an organization, CRM-5519
       // so reset loc blocks from main params.
       foreach ([
-                 'phone',
-                 'email',
-                 'address',
-               ] as $blk) {
+        'phone',
+        'email',
+        'address',
+      ] as $blk) {
         if (isset($this->_params[$blk])) {
           unset($this->_params[$blk]);
         }
@@ -606,24 +606,22 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
       $this->getPaymentProcessorObject()->getText('contributionPageContinueText', [
         'is_payment_to_existing' => !empty($this->_ccid),
         'amount' => $this->_amount,
-        ]
-      )
+      ])
     );
 
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => $contribButton,
-          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-          'isDefault' => TRUE,
-          'js' => ['onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');"],
-        ],
-        [
-          'type' => 'back',
-          'name' => ts('Go Back'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => $contribButton,
+        'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+        'isDefault' => TRUE,
+        'js' => ['onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');"],
+      ],
+      [
+        'type' => 'back',
+        'name' => ts('Go Back'),
+      ],
+    ]);
 
     $defaults = [];
     $fields = array_fill_keys(array_keys($this->_fields), 1);
@@ -635,9 +633,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
       if (isset($contact[$name]) && is_array($contact[$name]) && ($name == 'onbehalf' || $name == 'honor')) {
         foreach ($contact[$name] as $fieldName => $fieldValue) {
           if (is_array($fieldValue) && !in_array($this->_fields[$name][$fieldName]['html_type'], [
-              'Multi-Select',
-              'AdvMulti-Select',
-            ])
+            'Multi-Select',
+            'AdvMulti-Select',
+          ])
           ) {
             foreach ($fieldValue as $key => $value) {
               $defaults["{$name}[{$fieldName}][{$key}]"] = $value;
@@ -660,10 +658,10 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
           }
         }
         elseif (in_array($name, [
-            'addressee',
-            'email_greeting',
-            'postal_greeting',
-          ]) && !empty($contact[$name . '_custom'])
+          'addressee',
+          'email_greeting',
+          'postal_greeting',
+        ]) && !empty($contact[$name . '_custom'])
         ) {
           $defaults[$name . '_custom'] = $contact[$name . '_custom'];
         }
@@ -1333,11 +1331,11 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
       $params['pcp_is_anonymous'] = 0;
     }
     foreach ([
-               'pcp_display_in_roll',
-               'pcp_is_anonymous',
-               'pcp_roll_nickname',
-               'pcp_personal_note',
-             ] as $val) {
+      'pcp_display_in_roll',
+      'pcp_is_anonymous',
+      'pcp_roll_nickname',
+      'pcp_personal_note',
+    ] as $val) {
       if (!empty($params[$val])) {
         $page->assign($val, $params[$val]);
       }
index 4fd859f9bf016459acb86013f539877b0d9d3559..601c8e08fd2ebbbca2caba0e5171d0bf5feee9a4 100644 (file)
@@ -38,6 +38,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
 
   /**
    * Define default MembershipType Id.
+   * @var int
    */
   public $_defaultMemTypeId;
 
@@ -238,14 +239,10 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
               CRM_Price_BAO_PriceSet::setDefaultPriceSetField($priceFieldName, $keys, $val['html_type'], $this->_defaults);
               $memtypeID = $selectedCurrentMemTypes[] = $values['membership_type_id'];
             }
-            elseif (!empty($values['is_default']) &&
-              !$opMemTypeId &&
-              (!isset($this->_defaults[$priceFieldName]) ||
-                ($val['html_type'] == 'CheckBox' &&
-                !isset($this->_defaults[$priceFieldName][$keys]))
-              )) {
-                CRM_Price_BAO_PriceSet::setDefaultPriceSetField($priceFieldName, $keys, $val['html_type'], $this->_defaults);
-                $memtypeID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $this->_defaults[$priceFieldName], 'membership_type_id');
+            elseif (!empty($values['is_default']) && !$opMemTypeId && (!isset($this->_defaults[$priceFieldName]) ||
+              ($val['html_type'] == 'CheckBox' && !isset($this->_defaults[$priceFieldName][$keys])))) {
+              CRM_Price_BAO_PriceSet::setDefaultPriceSetField($priceFieldName, $keys, $val['html_type'], $this->_defaults);
+              $memtypeID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $this->_defaults[$priceFieldName], 'membership_type_id');
             }
           }
         }
index a82579729ab2392bd6e3c82eba909f2a31221ed1..842feec3b5a79a311267f2cf3fdb539c5b6a426e 100644 (file)
@@ -38,11 +38,13 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
 
   /**
    * Membership price set status.
+   * @var bool
    */
   public $_useForMember;
 
   /**
    * Tranxaaction Id of the current contribution
+   * @var string
    */
   public $_trxnId;
 
@@ -158,11 +160,11 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
       $qParams .= "&amp;pcpId={$this->_pcpId}";
       $this->assign('pcpBlock', TRUE);
       foreach ([
-                 'pcp_display_in_roll',
-                 'pcp_is_anonymous',
-                 'pcp_roll_nickname',
-                 'pcp_personal_note',
-               ] as $val) {
+        'pcp_display_in_roll',
+        'pcp_is_anonymous',
+        'pcp_roll_nickname',
+        'pcp_personal_note',
+      ] as $val) {
         if (!empty($this->_params[$val])) {
           $this->assign($val, $this->_params[$val]);
         }
@@ -246,10 +248,10 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
           }
         }
         elseif (in_array($name, [
-              'addressee',
-              'email_greeting',
-              'postal_greeting',
-            ]) && !empty($contact[$name . '_custom'])
+          'addressee',
+          'email_greeting',
+          'postal_greeting',
+        ]) && !empty($contact[$name . '_custom'])
         ) {
           $defaults[$name . '_custom'] = $contact[$name . '_custom'];
         }
index 4b22fae1a430674ad67a1f565fff5be1b57ff146..971479e6332d2b6c896d7208afd96a88fa06ee89 100644 (file)
@@ -181,9 +181,8 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
   public $_useForMember;
 
   /**
+   * @var bool
    * @deprecated
-   *
-   * @var
    */
   public $_isBillingAddressRequiredForPayLater;
 
@@ -1393,7 +1392,6 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
     }
   }
 
-
   /**
    * Get the payment processor object for the submission, returning the manual one for offline payments.
    *
index f8c10cd1ccd842bc8b10e4b411ca05cb9e80367a..ac5866da5bd00bd10a6453274356642e48dfa157 100644 (file)
@@ -66,10 +66,9 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form {
     //p3 = Three dimensional pie chart.
     //bvg = Vertical bar chart
     $this->addElement('select', 'chart_type', ts('Chart Style'), [
-        'bvg' => ts('Bar'),
-        'p3' => ts('Pie'),
-      ]
-    );
+      'bvg' => ts('Bar'),
+      'p3' => ts('Pie'),
+    ]);
     $defaultValues['chart_type'] = $this->_chartType;
     $this->setDefaults($defaultValues);
 
index b426a3b927804fcb30633b08ff1f96ff7a37e492..a7e95aedfe8d551dfa80d96e785f34e67ee0f84d 100644 (file)
@@ -452,6 +452,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
    *
    * @return string
    */
+
   /**
    * @return string
    */
index 70adad65a12c8bedc8f8624431c0fc4d124ff66b..4808e1f73bc3d2fd50ad1676ffe20aeacd3c45c6 100644 (file)
@@ -100,7 +100,7 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
       $dao->fetch();
       $defaults['weight'] = $dao->max_weight + 1;
     }
-    RETURN $defaults;
+    return $defaults;
   }
 
   /**
@@ -124,31 +124,29 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
       }
 
       $this->addButtons([
-          [
-            'type' => 'next',
-            'name' => ts('Delete'),
-            'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;',
-            'isDefault' => TRUE,
-          ],
-          [
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ],
-        ]
-      );
+        [
+          'type' => 'next',
+          'name' => ts('Delete'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;',
+          'isDefault' => TRUE,
+        ],
+        [
+          'type' => 'cancel',
+          'name' => ts('Cancel'),
+        ],
+      ]);
       return;
     }
 
     if ($this->_action & CRM_Core_Action::PREVIEW) {
       CRM_Contribute_BAO_Premium::buildPremiumPreviewBlock($this, NULL, $this->_pid);
       $this->addButtons([
-          [
-            'type' => 'next',
-            'name' => ts('Done with Preview'),
-            'isDefault' => TRUE,
-          ],
-        ]
-      );
+        [
+          'type' => 'next',
+          'name' => ts('Done with Preview'),
+          'isDefault' => TRUE,
+        ],
+      ]);
       return;
     }
 
@@ -202,18 +200,17 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
 
     if ($this->_single) {
       $this->addButtons([
-          [
-            'type' => 'next',
-            'name' => ts('Save'),
-            'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;',
-            'isDefault' => TRUE,
-          ],
-          [
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ],
-        ]
-      );
+        [
+          'type' => 'next',
+          'name' => ts('Save'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;',
+          'isDefault' => TRUE,
+        ],
+        [
+          'type' => 'cancel',
+          'name' => ts('Cancel'),
+        ],
+      ]);
     }
     else {
       parent::buildQuickForm();
index 6de2f49ffaa43454ed53fe768908cebb49240455..ed7efb2d82e9738cb5652499fe9e05752d3f2dce 100644 (file)
@@ -224,11 +224,11 @@ class CRM_Contribute_Form_ContributionPage_Amount extends CRM_Contribute_Form_Co
           $options = $pFIDs = [];
           $priceFieldParams = ['price_set_id' => $priceSetId];
           $priceFields = CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = [
-              'html_type',
-              'name',
-              'is_active',
-              'label',
-            ]);
+            'html_type',
+            'name',
+            'is_active',
+            'label',
+          ]);
           foreach ($priceFields as $priceField) {
             if ($priceField['id'] && $priceField['html_type'] == 'Radio' && $priceField['name'] == 'contribution_amount') {
               $defaults['price_field_id'] = $priceField['id'];
index b89a1448be692dcc962349620b51a045f06dcd7b..a715b136d8b2c301f8ba62c46a5112ab3764ecc5 100644 (file)
@@ -45,6 +45,7 @@ class CRM_Contribute_Form_ContributionPage_Delete extends CRM_Contribute_Form_Co
 
   /**
    * Check if there are any related contributions.
+   * @var bool
    */
   protected $_relatedContributions;
 
index c2f7aa06a7e3558b8e669e90f837662cb7039da6..0e7ae3ae58f8258ad42115e39a3d69bf959b0ec5 100644 (file)
@@ -213,11 +213,11 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
     ];
 
     $allowCoreTypes = array_merge([
-        'Contact',
-        'Individual',
-        'Organization',
-        'Household',
-      ], CRM_Contact_BAO_ContactType::subTypes('Individual'));
+      'Contact',
+      'Individual',
+      'Organization',
+      'Household',
+    ], CRM_Contact_BAO_ContactType::subTypes('Individual'));
     $allowSubTypes = [];
 
     $this->addProfileSelector('honoree_profile', ts('Honoree Profile'), $allowCoreTypes, $allowSubTypes, $entities);
index 0becb7fb8af94f41a66c1be5a5a674efbab629a9..c24edb0726e83f886923e5d7a5089678246b536f 100644 (file)
@@ -35,6 +35,7 @@
  * Helper class to build navigation links.
  */
 class CRM_Contribute_Form_ContributionPage_TabHeader {
+
   /**
    * @param CRM_Core_Form $form
    *
index 99b02342bdac17a0f2abd457c8567abb0e6e5f6a..a9eb615488e0df47f3fb9c4493f55b562004df94 100644 (file)
@@ -275,7 +275,7 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form {
    *
    * @param int $id
    *
-   * @return string $title
+   * @return string
    *   Block title.
    */
   protected function assignPaymentInfoBlock($id) {
index 6cfbe11798cdd96f9d9a56843fb5df77b5d0a8f5..bbb5543e20f049081e9e5f8915f196f48d449f64 100644 (file)
@@ -92,9 +92,9 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
     $this->applyFilter('__ALL__', 'trim');
     $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'name'), TRUE);
     $this->addRule('name', ts('A product with this name already exists. Please select another name.'), 'objectExists', [
-        'CRM_Contribute_DAO_Product',
-        $this->_id,
-      ]);
+      'CRM_Contribute_DAO_Product',
+      $this->_id,
+    ]);
     $this->add('text', 'sku', ts('SKU'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'sku'));
 
     $this->add('textarea', 'description', ts('Description'), 'rows=3, cols=60');
@@ -124,10 +124,10 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
     $this->add('textarea', 'options', ts('Options'), 'rows=3, cols=60');
 
     $this->add('select', 'period_type', ts('Period Type'), [
-        '' => '- select -',
-        'rolling' => 'Rolling',
-        'fixed' => 'Fixed',
-      ]);
+      '' => '- select -',
+      'rolling' => 'Rolling',
+      'fixed' => 'Fixed',
+    ]);
 
     $this->add('text', 'fixed_period_start_day', ts('Fixed Period Start Day'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'fixed_period_start_day'));
 
@@ -181,17 +181,16 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
     $this->addFormRule(['CRM_Contribute_Form_ManagePremiums', 'formRule']);
 
     $this->addButtons([
-        [
-          'type' => 'upload',
-          'name' => ts('Save'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'upload',
+        'name' => ts('Save'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
     $this->assign('productId', $this->_id);
   }
 
index 3aa1d912bfa89955248f26aef545bbe33c42dfa6..8351b6d9ad8bd399b8215354a4e2a53dcfa01087 100644 (file)
@@ -59,10 +59,10 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search {
 
   /**
    * Prefix for the controller.
+   * @var string
    */
   protected $_prefix = "contribute_";
 
-
   /**
    * Explicitly declare the entity api name.
    */
@@ -270,9 +270,9 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search {
     }
 
     foreach ([
-               'contribution_amount_low',
-               'contribution_amount_high',
-             ] as $f) {
+      'contribution_amount_low',
+      'contribution_amount_high',
+    ] as $f) {
       if (isset($this->_formValues[$f])) {
         $this->_formValues[$f] = CRM_Utils_Rule::cleanMoney($this->_formValues[$f]);
       }
index b45472fda66f70f02e014898b831bcf505179cee..431cb24dce16639110175c292faee497e56fa4e8 100644 (file)
@@ -101,10 +101,10 @@ class CRM_Contribute_Form_SoftCredit {
       $form->addMoney("soft_credit_amount[{$rowNumber}]", ts('Amount'), FALSE, NULL, FALSE);
 
       $form->addSelect("soft_credit_type[{$rowNumber}]", [
-          'entity' => 'contribution_soft',
-          'field' => 'soft_credit_type_id',
-          'label' => ts('Type'),
-        ]);
+        'entity' => 'contribution_soft',
+        'field' => 'soft_credit_type_id',
+        'label' => ts('Type'),
+      ]);
       if (!empty($form->_softCreditInfo['soft_credit'][$rowNumber]['soft_credit_id'])) {
         $form->add('hidden', "soft_credit_id[{$rowNumber}]",
           $form->_softCreditInfo['soft_credit'][$rowNumber]['soft_credit_id']);
index 0414b694d789baaeb8870c223414556aea667de7..8e6eb1d3ad3c9a249d8dd877fb17b8b426d637ff 100644 (file)
@@ -209,17 +209,16 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form_Task {
    */
   public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
     $this->addButtons([
-        [
-          'type' => $nextType,
-          'name' => $title,
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => $backType,
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => $nextType,
+        'name' => $title,
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => $backType,
+        'name' => ts('Cancel'),
+      ],
+    ]);
   }
 
 }
index 2e52dccdef95ce92d203f8e88a768f3321beaf25..b2f32ee2549c1daf7ba0f64d54497fac149a6653 100644 (file)
@@ -45,11 +45,13 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task {
 
   /**
    * Maximum profile fields that will be displayed
+   * @var int
    */
   protected $_maxFields = 9;
 
   /**
    * Variable to store redirect path
+   * @var string
    */
   protected $_userContext;
 
@@ -113,17 +115,16 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task {
     $this->_fields = array_slice($this->_fields, 0, $this->_maxFields);
 
     $this->addButtons([
-        [
-          'type' => 'submit',
-          'name' => ts('Update Contribution(s)'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'submit',
+        'name' => ts('Update Contribution(s)'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
 
     $this->assign('profileTitle', $this->_title);
     $this->assign('componentIds', $this->_contributionIds);
index 82c69c935af6cc894f60af7db61968d52ae421d9..8601ee564c11fd73a8fbaf4159d980e237a065a1 100644 (file)
@@ -88,8 +88,7 @@ class CRM_Contribute_Form_Task_Delete extends CRM_Contribute_Form_Task {
           'type' => 'back',
           'name' => ts('Cancel'),
         ],
-       ]
-      );
+      ]);
     }
     elseif ($count && !empty($this->_contributionIds)) {
       CRM_Core_Session::setStatus(ts('1 contribution will not be deleted.', ['plural' => '%count contributions will not be deleted.', 'count' => $count]), ts('Warning'), 'warning');
index dffc33c9f4ede0589d6b47b621699d1815600eee..f2742ee109e2dfb00e38dfad622818ce66593646 100644 (file)
@@ -49,21 +49,25 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
 
   /**
    * Gives all the statues for conribution.
+   * @var int
    */
   public $_contributionStatusId;
 
   /**
    * Gives the HTML template of PDF Invoice.
+   * @var string
    */
   public $_messageInvoice;
 
   /**
    * This variable is used to assign parameters for HTML template of PDF Invoice.
+   * @var string
    */
   public $_invoiceTemplate;
 
   /**
    * Selected output.
+   * @var string
    */
   public $_selectedOutput;
 
@@ -164,17 +168,16 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
     ]);
 
     $this->addButtons([
-        [
-          'type' => 'upload',
-          'name' => $this->_selectedOutput == 'email' ? ts('Send Email') : ts('Process Invoice(s)'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'upload',
+        'name' => $this->_selectedOutput == 'email' ? ts('Send Email') : ts('Process Invoice(s)'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
   }
 
   /**
@@ -307,8 +310,8 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
       }
 
       $resultPayments = civicrm_api3('Payment', 'get', [
-            'sequential' => 1,
-            'contribution_id' => $contribID,
+        'sequential' => 1,
+        'contribution_id' => $contribID,
       ]);
       $amountPaid = 0;
       foreach ($resultPayments['values'] as $singlePayment) {
@@ -557,7 +560,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
    *   For invoices.
    *
    */
-  static public function addActivities($subject, $contactIds, $fileName, $params) {
+  public static function addActivities($subject, $contactIds, $fileName, $params) {
     $session = CRM_Core_Session::singleton();
     $userID = $session->get('userID');
     $config = CRM_Core_Config::singleton();
@@ -605,7 +608,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
    * @return string
    *   Name of file which is in pdf format
    */
-  static public function putFile($html, $name = 'Invoice.pdf') {
+  public static function putFile($html, $name = 'Invoice.pdf') {
     $options = new Options();
     $options->set('isRemoteEnabled', TRUE);
 
index aff1abaf0d3f86870c939d1b01339276a967a2c6..c27b4fd176ac0d65fb3ebfced6cd9212d79a04af 100644 (file)
@@ -106,12 +106,14 @@ AND    {$this->_componentClause}";
     $this->addElement('radio', 'output', NULL, ts('Email Receipts'), 'email_receipt',
       [
         'onClick' => "document.getElementById('selectPdfFormat').style.display = 'none';
-        document.getElementById('selectEmailFrom').style.display = 'block';"]
+        document.getElementById('selectEmailFrom').style.display = 'block';",
+      ]
     );
     $this->addElement('radio', 'output', NULL, ts('PDF Receipts'), 'pdf_receipt',
       [
         'onClick' => "document.getElementById('selectPdfFormat').style.display = 'block';
-        document.getElementById('selectEmailFrom').style.display = 'none';"]
+        document.getElementById('selectEmailFrom').style.display = 'none';",
+      ]
     );
     $this->addRule('output', ts('Selection required'), 'required');
 
@@ -124,17 +126,16 @@ AND    {$this->_componentClause}";
     $this->add('select', 'from_email_address', ts('From Email'), $this->_fromEmails, FALSE);
 
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => ts('Process Receipt(s)'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'back',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => ts('Process Receipt(s)'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'back',
+        'name' => ts('Cancel'),
+      ],
+    ]);
   }
 
   /**
@@ -193,7 +194,8 @@ AND    {$this->_componentClause}";
           FROM civicrm_financial_trxn
           WHERE trxn_id = %1
           LIMIT 1", [
-            1 => [$contribution->trxn_id, 'String']]);
+            1 => [$contribution->trxn_id, 'String'],
+          ]);
 
       // CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date
       $objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date);
@@ -262,7 +264,7 @@ AND    {$this->_componentClause}";
    *   array of common elements
    *
    */
-  static public function getElements($contribIds, $params, $contactIds) {
+  public static function getElements($contribIds, $params, $contactIds) {
     $pdfElements = [];
 
     $pdfElements['contribIDs'] = implode(',', $contribIds);
index b481060195e30659494432316b81e688d7a4fc14..03620ec4dd2cc01ace3850ad66943223ba94c821 100644 (file)
@@ -84,6 +84,7 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task {
    * @return array
    *   reference to the array of default values
    */
+
   /**
    * @return array
    */
@@ -142,17 +143,16 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task {
     $this->addElement('select', 'email_options', ts('Print and email options'), $emailOptions, [], "<br/>", FALSE);
 
     $this->addButtons([
-        [
-          'type' => 'upload',
-          'name' => ts('Make Thank-you Letters'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Done'),
-        ],
-      ]
-    );
+      [
+        'type' => 'upload',
+        'name' => ts('Make Thank-you Letters'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Done'),
+      ],
+    ]);
 
   }
 
index c6af7bcd7c5dbe3a8f668f12a74e7ffb618d9d0c..88a870f7169d3727d8c47a30d07dd887250c38c6 100644 (file)
@@ -70,7 +70,8 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
         $realSeparator = "<br />";
       }
     }
-    $separator = '****~~~~';// a placeholder in case the separator is common in the string - e.g ', '
+    // a placeholder in case the separator is common in the string - e.g ', '
+    $separator = '****~~~~';
     $groupBy = $formValues['group_by'];
 
     // skip some contacts ?
index c4908eb0688ab12326aa4952fbb98b6d8a4691dd..9d45ddafcd21382f1ee2ee8783a41e6a2f188c36 100644 (file)
@@ -45,11 +45,13 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task {
 
   /**
    * Maximum contributions that should be allowed to update
+   * @var int
    */
   protected $_maxContributions = 100;
 
   /**
    * Variable to store redirect path
+   * @var string
    */
   protected $_userContext;
 
@@ -68,9 +70,9 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task {
     //validations
     if (count($this->_contributionIds) > $this->_maxContributions) {
       CRM_Core_Session::setStatus(ts("The maximum number of contributions you can select for Update multiple contributions is %1. You have selected %2. Please select fewer contributions from your search results and try again.", [
-            1 => $this->_maxContributions,
-            2 => count($this->_contributionIds),
-          ]), ts('Update multiple records error'), 'error');
+        1 => $this->_maxContributions,
+        2 => count($this->_contributionIds),
+      ]), ts('Update multiple records error'), 'error');
       $validate = TRUE;
     }
 
index 132e2cefe8867dbeb7b945267944173838804de7..58055ce580e5d53e57cc85ddccd970cd60cbfff3 100644 (file)
@@ -73,18 +73,17 @@ class CRM_Contribute_Form_Task_Print extends CRM_Contribute_Form_Task {
     // just need to add a javascript to popup the window for printing
     //
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => ts('Print Contributions'),
-          'js' => ['onclick' => 'window.print()'],
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'back',
-          'name' => ts('Done'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => ts('Print Contributions'),
+        'js' => ['onclick' => 'window.print()'],
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'back',
+        'name' => ts('Done'),
+      ],
+    ]);
   }
 
   /**
index 6e9c0999ef202041ee48e9fb3f18fd487c85b2c5..11ff679294d5b46e40b5c4e80d4cd027a8abc75a 100644 (file)
@@ -47,13 +47,12 @@ class CRM_Contribute_Form_Task_Result extends CRM_Contribute_Form_Task {
    */
   public function buildQuickForm() {
     $this->addButtons([
-        [
-          'type' => 'done',
-          'name' => ts('Done'),
-          'isDefault' => TRUE,
-        ],
-      ]
-    );
+      [
+        'type' => 'done',
+        'name' => ts('Done'),
+        'isDefault' => TRUE,
+      ],
+    ]);
   }
 
 }
index ce9e319b8481ec848fc41bf01f13cc3d70d85252..6c84b5315d193be9ba4d804f3951d14da3490d91 100644 (file)
@@ -75,13 +75,12 @@ INNER JOIN civicrm_contact ct ON ( co.contact_id = ct.id )
    */
   public function buildQuickForm() {
     $this->addButtons([
-        [
-          'type' => 'done',
-          'name' => ts('Done'),
-          'isDefault' => TRUE,
-        ],
-      ]
-    );
+      [
+        'type' => 'done',
+        'name' => ts('Done'),
+        'isDefault' => TRUE,
+      ],
+    ]);
   }
 
 }
index 08262c92b3d560e135997bece54e513e854cbea8..348ed223870d9782034c74e6058f987448fedfd3 100644 (file)
@@ -155,17 +155,16 @@ AND    co.id IN ( $contribIDs )";
     $this->assign_by_ref('rows', $this->_rows);
     $this->setDefaults($defaults);
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => ts('Update Pending Status'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'back',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => ts('Update Pending Status'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'back',
+        'name' => ts('Cancel'),
+      ],
+    ]);
 
     $this->addFormRule(['CRM_Contribute_Form_Task_Status', 'formRule']);
   }
@@ -292,7 +291,7 @@ AND    co.id IN ( $contribIDs )";
       else {
         $input['trxn_id'] = $contribution->invoice_id;
       }
-      $input['trxn_date'] = $params["trxn_date_{$row['contribution_id']}"] . ' ' .  date('H:i:s');
+      $input['trxn_date'] = $params["trxn_date_{$row['contribution_id']}"] . ' ' . date('H:i:s');
 
       // @todo calling baseIPN like this is a pattern in it's last gasps. Call contribute.completetransaction api.
       $baseIPN->completeTransaction($input, $ids, $objects, $transaction, FALSE);
index 03c3b80c71724a36ea8908bf7f1b4a425cab1b92..8d58d978e0cee6c01942d34a1056dbb124503291 100644 (file)
@@ -173,17 +173,16 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Contribute_Form_Contribution
     }
 
     $this->addButtons(array(
-        array(
-          'type' => $type,
-          'name' => ts('Save'),
-          'isDefault' => TRUE,
-        ),
-        array(
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ),
-      )
-    );
+      array(
+        'type' => $type,
+        'name' => ts('Save'),
+        'isDefault' => TRUE,
+      ),
+      array(
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ),
+    ));
 
     CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, TRUE, TRUE);
     $this->addFormRule(array('CRM_Contribute_Form_UpdateBilling', 'formRule'), $this);
index cbe2ee8333914573dd5bcfaf2a8597d26e6548f5..7b4be7a22c462df42cb3aea3917f59e6e6c61f14 100644 (file)
@@ -215,17 +215,16 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib
 
     // define the buttons
     $this->addButtons([
-        [
-          'type' => $type,
-          'name' => ts('Save'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => $type,
+        'name' => ts('Save'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
   }
 
   /**
@@ -290,9 +289,9 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib
 
       if ($this->_subscriptionDetails->installments != $params['installments']) {
         $message .= "<br /> " . ts("Recurring contribution installments have been updated from %1 to %2 for this subscription.", [
-              1 => $this->_subscriptionDetails->installments,
-              2 => $params['installments'],
-            ]) . ' ';
+          1 => $this->_subscriptionDetails->installments,
+          2 => $params['installments'],
+        ]) . ' ';
       }
 
       $activityParams = [
index fdd1ce6177eec0fcc2ec049c3262c18baaee6334..969441ef83e98aa614a594cbe88c32b795740a21 100644 (file)
  */
 class CRM_Contribute_Import_Field {
 
-  /**#@+
+  /**
+   * #@+
    * @var string
    */
 
   /**
    * Name of the field
+   * @var string
    */
   public $_name;
 
   /**
    * Title of the field to be used in display
+   * @var string
    */
   public $_title;
 
index 84449eea9801208c1e96ae2e4aa677ef85b7da49..e0f58c436e7733305ec56323f5ad6f7ad0147054 100644 (file)
@@ -36,7 +36,6 @@
  */
 class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
 
-
   /**
    * Set variables up before form is built.
    */
@@ -79,10 +78,10 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
 
       //modify field title only for update mode. CRM-3245
       foreach ([
-                 'contribution_id',
-                 'invoice_id',
-                 'trxn_id',
-               ] as $key) {
+        'contribution_id',
+        'invoice_id',
+        'trxn_id',
+      ] as $key) {
         $this->_mapperFields[$key] .= ' (match to contribution record)';
         $highlightedFields[] = $key;
       }
@@ -384,8 +383,8 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
               $self->_onDuplicate != CRM_Import_Parser::DUPLICATE_UPDATE
             ) {
               $errors['_qf_default'] .= ts('Missing required contact matching fields.') . " $fieldMessage " . ts('(Sum of all weights should be greater than or equal to threshold: %1).', [
-                  1 => $threshold,
-                ]) . '<br />';
+                1 => $threshold,
+              ]) . '<br />';
             }
             elseif ($self->_onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE &&
               !(in_array('invoice_id', $importKeys) || in_array('trxn_id', $importKeys) ||
@@ -397,8 +396,8 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
           }
           else {
             $errors['_qf_default'] .= ts('Missing required field: %1', [
-                1 => $title,
-              ]) . '<br />';
+              1 => $title,
+            ]) . '<br />';
           }
         }
       }
index 57a0156537c1c988557f45a3011cda55c994619b..939eef3d8018cb4e131661452f038b37e5ffc3c9 100644 (file)
@@ -38,50 +38,62 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
    */
   const SOFT_CREDIT = 512, SOFT_CREDIT_ERROR = 1024, PLEDGE_PAYMENT = 2048, PLEDGE_PAYMENT_ERROR = 4096;
 
+  /**
+   * @var string
+   */
   protected $_fileName;
 
   /**
    * Imported file size
+   * @var int
    */
   protected $_fileSize;
 
   /**
    * Seperator being used
+   * @var string
    */
   protected $_seperator;
 
   /**
    * Total number of lines in file
+   * @var int
    */
   protected $_lineCount;
 
   /**
    * Running total number of valid soft credit rows
+   * @var int
    */
   protected $_validSoftCreditRowCount;
 
   /**
    * Running total number of invalid soft credit rows
+   * @var int
    */
   protected $_invalidSoftCreditRowCount;
 
   /**
    * Running total number of valid pledge payment rows
+   * @var int
    */
   protected $_validPledgePaymentRowCount;
 
   /**
    * Running total number of invalid pledge payment rows
+   * @var int
    */
   protected $_invalidPledgePaymentRowCount;
 
   /**
    * Array of pledge payment error lines, bounded by MAX_ERROR
+   * @var array
    */
   protected $_pledgePaymentErrors;
 
   /**
    * Array of pledge payment error lines, bounded by MAX_ERROR
+   * @var array
    */
   protected $_softCreditErrors;
 
@@ -114,6 +126,8 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
    * @param int $mode
    * @param int $contactType
    * @param int $onDuplicate
+   * @param int $statusID
+   * @param int $totalRowCount
    *
    * @return mixed
    * @throws Exception
@@ -346,11 +360,9 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
       if ($this->_invalidRowCount) {
         // removed view url for invlaid contacts
         $headers = array_merge([
-            ts('Line Number'),
-            ts('Reason'),
-          ],
-          $customHeaders
-        );
+          ts('Line Number'),
+          ts('Reason'),
+        ], $customHeaders);
         $this->_errorFileName = self::errorFileName(self::ERROR);
         self::exportCSV($this->_errorFileName, $headers, $this->_errors);
       }
@@ -358,11 +370,9 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
       if ($this->_invalidPledgePaymentRowCount) {
         // removed view url for invlaid contacts
         $headers = array_merge([
-            ts('Line Number'),
-            ts('Reason'),
-          ],
-          $customHeaders
-        );
+          ts('Line Number'),
+          ts('Reason'),
+        ], $customHeaders);
         $this->_pledgePaymentErrorsFileName = self::errorFileName(self::PLEDGE_PAYMENT_ERROR);
         self::exportCSV($this->_pledgePaymentErrorsFileName, $headers, $this->_pledgePaymentErrors);
       }
@@ -370,32 +380,26 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
       if ($this->_invalidSoftCreditRowCount) {
         // removed view url for invlaid contacts
         $headers = array_merge([
-            ts('Line Number'),
-            ts('Reason'),
-          ],
-          $customHeaders
-        );
+          ts('Line Number'),
+          ts('Reason'),
+        ], $customHeaders);
         $this->_softCreditErrorsFileName = self::errorFileName(self::SOFT_CREDIT_ERROR);
         self::exportCSV($this->_softCreditErrorsFileName, $headers, $this->_softCreditErrors);
       }
 
       if ($this->_conflictCount) {
         $headers = array_merge([
-            ts('Line Number'),
-            ts('Reason'),
-          ],
-          $customHeaders
-        );
+          ts('Line Number'),
+          ts('Reason'),
+        ], $customHeaders);
         $this->_conflictFileName = self::errorFileName(self::CONFLICT);
         self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
       }
       if ($this->_duplicateCount) {
         $headers = array_merge([
-            ts('Line Number'),
-            ts('View Contribution URL'),
-          ],
-          $customHeaders
-        );
+          ts('Line Number'),
+          ts('View Contribution URL'),
+        ], $customHeaders);
 
         $this->_duplicateFileName = self::errorFileName(self::DUPLICATE);
         self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates);
index 3d6dbd769199e7960b0ebb6a3ecdcc411ccf7816..6ee91c40ef6de7d8057a847bfc19a528992da121 100644 (file)
@@ -48,7 +48,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa
   /**
    * Array of successfully imported contribution id's
    *
-   * @array
+   * @var array
    */
   protected $_newContributions;
 
index b6934b6167e1bda9e00f2dc653698b470e30fed3..6fd1c9c51c394e4f4116ef68502b9583797fdcee 100644 (file)
@@ -37,6 +37,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
 
 
   /**
+   * @var string
    * @inheritDoc
    */
   protected $keyword = 'contribute';
@@ -50,6 +51,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    * @return array
    *   collection of required component settings
    */
+
   /**
    * @return array
    */
@@ -114,6 +116,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    *   list of permissions
    * @see CRM_Component_Info::getPermissions
    */
+
   /**
    * @return array
    */
@@ -132,6 +135,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    *   collection of required dashboard settings,
    *                    null if no element offered
    */
+
   /**
    * @return array|null
    */
@@ -153,6 +157,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    *   collection of required dashboard settings,
    *                    null if no element offered
    */
+
   /**
    * @return array|null
    */
@@ -181,6 +186,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    *   collection of required pane settings,
    *                    null if no element offered
    */
+
   /**
    * @return array|null
    */
@@ -201,6 +207,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    * @return array|null
    *   collection of activity types
    */
+
   /**
    * @return array|null
    */
index 1f3c70c5fbd2fd8d20f9f1f281e4e6b1b23575b1..9cbfacdd6af3d7fcc16294591e545b91a7357e41 100644 (file)
@@ -36,6 +36,7 @@
  * This class contains all the function that are called using AJAX (jQuery)
  */
 class CRM_Contribute_Page_AJAX {
+
   /**
    * Get Soft credit to list in DT
    */
index 7771184f1947ed7a8ebc4b6a9d976836c971fbcf..0f9f8df41a68c4bda3cbea3ad3be835572a9b77c 100644 (file)
@@ -215,7 +215,8 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page {
           'title' => ts('Test-drive'),
           'url' => $urlString,
           'qs' => $urlParams . '&action=preview',
-          'fe' => TRUE, // Addresses https://lab.civicrm.org/dev/core/issues/658
+          // Addresses https://lab.civicrm.org/dev/core/issues/658
+          'fe' => TRUE,
           'uniqueName' => 'test_drive',
         ),
       );
index 6a5029d0763a3d3ec8164f0dcf9a8bf37f258309..7aa68b264e3d068f4f37ef8fc5d8bfdc5132b95d 100644 (file)
@@ -36,7 +36,7 @@
  */
 class CRM_Contribute_Page_ContributionRecur extends CRM_Core_Page {
 
-  static $_links = NULL;
+  public static $_links = NULL;
   public $_permission = NULL;
   public $_contactId = NULL;
   public $_id = NULL;
index 29893f8812ba05183aae520f6231ddaff0bf381c..59b07ffda40904f72fb0d4266b8c76f0d63fdec6 100644 (file)
@@ -52,10 +52,10 @@ class CRM_Contribute_Page_DashBoard extends CRM_Core_Page {
     //get contribution dates.
     $dates = CRM_Contribute_BAO_Contribution::getContributionDates();
     foreach ([
-               'now',
-               'yearDate',
-               'monthDate',
-             ] as $date) {
+      'now',
+      'yearDate',
+      'monthDate',
+    ] as $date) {
       $$date = $dates[$date];
     }
     // fiscal years end date
index c4f0939a61afb8febcc55edca0ffd133a271ba33..f4d41cf60a0333c5f002893beca1163f5c7f10da 100644 (file)
@@ -43,7 +43,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
 
   /**
    * Get BAO Name.
index 5b17464568b977a29afdc2bad434e20868a6ba8a..bfb9e8436180515ea3cb3cb0f0c9dc8077ca6bce 100644 (file)
@@ -31,6 +31,7 @@
  * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Contribute_Page_PaymentInfo extends CRM_Core_Page {
+
   public function preProcess() {
     $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this, TRUE);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
index f87dff5bbc7857455714a6b6fd4f4d24eee5837e..b93544e30703228495383a676e633365e3f4dd01 100644 (file)
@@ -37,8 +37,8 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
    *
    * @var array
    */
-  static $_links = NULL;
-  static $_recurLinks = NULL;
+  public static $_links = NULL;
+  public static $_recurLinks = NULL;
   public $_permission = NULL;
   public $_contactId = NULL;
   public $_crid = NULL;
@@ -157,7 +157,8 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
         $softCreditTotals['cancel']['count'],
         $softCreditTotals['amount'],
         $softCreditTotals['avg'],
-        $softCreditTotals['cancel']['amount'] // to get cancel amount
+        // to get cancel amount
+        $softCreditTotals['cancel']['amount']
         ) = CRM_Contribute_BAO_ContributionSoft::getSoftContributionTotals($this->_contactId, $isTest);
 
       $this->assign('softCredit', TRUE);
@@ -338,9 +339,9 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
       $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, empty($this->_id));
       if (empty($this->_contactId)) {
         $this->_contactId = civicrm_api3('contribution', 'getvalue', [
-            'id' => $this->_id,
-            'return' => 'contact_id',
-          ]);
+          'id' => $this->_id,
+          'return' => 'contact_id',
+        ]);
       }
       $this->assign('contactId', $this->_contactId);
 
index c8fa53a775d8cf6899b1b6f37cc13223480aaf00..f2250641c62530a6f4aad5bb3119f8da0e397da3 100644 (file)
@@ -40,20 +40,20 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
 
   /**
    * We use desc to remind us what that column is, name is used in the tpl
    *
    * @var array
    */
-  static $_columnHeaders;
+  public static $_columnHeaders;
 
   /**
    * Properties of contact we're interested in displaying
    * @var array
    */
-  static $_properties = [
+  public static $_properties = [
     'contact_id',
     'contribution_id',
     'contact_type',
index 43ac47fa1989c13609178a6d0d4a699bf5580e08..62c0d6c07885136a03910993814d08fe24c6bc20 100644 (file)
@@ -78,7 +78,8 @@ class CRM_Contribute_StateMachine_Search extends CRM_Core_StateMachine {
    *
    * @param string $formName
    *
-   * @return array [ 'class' => task classname, 'result' => TRUE ]
+   * @return array
+   *   [ 'class' => task classname, 'result' => TRUE ]
    *   the name of the form that will handle the task
    */
   public function taskName($controller, $formName = 'Search') {
index 2c6065350ac15da25c773b36e45d335e7eda5f08..c7679aab1b5bca9a1a25137af065858787a8db9c 100644 (file)
  */
 class CRM_Contribute_Task extends CRM_Core_Task {
 
+  /**
+   * Contribution tasks
+   */
   const
-    // Contribution tasks
     UPDATE_STATUS = 401,
     PDF_RECEIPT = 402,
     PDF_THANKYOU = 403,
     PDF_INVOICE = 404;
 
-  static $objectType = 'contribution';
+  /**
+   * @var string
+   */
+  public static $objectType = 'contribution';
 
   /**
    * These tasks are the core set of tasks that the user can perform
index 5906f5e969eb8670daa6e7054688d5cd6f451394..25d247c51f5902a7e66a192a3550f2688f3b4ccd 100644 (file)
@@ -97,8 +97,7 @@ class CRM_Contribute_Tokens extends \Civi\Token\AbstractTokenSubscriber {
    * @return bool
    */
   public function checkActive(\Civi\Token\TokenProcessor $processor) {
-    return
-      !empty($processor->context['actionMapping'])
+    return !empty($processor->context['actionMapping'])
       && $processor->context['actionMapping']->getEntity() === 'civicrm_contribution';
   }