From f174ed0be432f82f0060894aefc48df8ea8f348b Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 15 Jan 2020 09:26:05 +1300 Subject: [PATCH] [NFC] Minor code cleanup --- CRM/Contribute/Form/AbstractEditPayment.php | 4 +++- CRM/Contribute/Form/Contribution.php | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 160544bb27..04be631bb1 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -232,6 +232,9 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task { /** * Pre process function with common actions. + * + * @throws \CRM_Core_Exception + * @throws \CiviCRM_API3_Exception */ public function preProcess() { $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this); @@ -530,7 +533,6 @@ WHERE contribution_id = {$id} /** * Common block for setting up the parts of a form that relate to credit / debit card - * @throws Exception */ protected function assignPaymentRelatedVariables() { try { diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 49e580d30f..16a5149326 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -211,6 +211,9 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP /** * Set variables up before form is built. + * + * @throws \CRM_Core_Exception + * @throws \CiviCRM_API3_Exception */ public function preProcess() { // Check permission for action. @@ -279,7 +282,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->_lineItems = []; if ($this->_id) { - if (!empty($this->_compId) && $this->_compContext == 'participant') { + if (!empty($this->_compId) && $this->_compContext === 'participant') { $this->assign('compId', $this->_compId); $lineItem = CRM_Price_BAO_LineItem::getLineItems($this->_compId); } @@ -310,6 +313,8 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * Set default values. * * @return array + * + * @throws \CRM_Core_Exception */ public function setDefaultValues() { $defaults = $this->_values; @@ -450,6 +455,9 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP /** * Build the form object. + * + * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function buildQuickForm() { if ($this->_id) { @@ -608,7 +616,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->assign('entityID', $this->_id); $contactField = $this->addEntityRef('contact_id', ts('Contributor'), ['create' => TRUE], TRUE); - if ($this->_context != 'standalone') { + if ($this->_context !== 'standalone') { $contactField->freeze(); } -- 2.25.1