From 03110609b412559a89fa6672013c0f08b4975c0a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 1 Nov 2014 07:52:32 +1300 Subject: [PATCH] fix a few comment blocks, minor tidy ups --- CRM/Contribute/Form/AbstractEditPayment.php | 7 +++++++ CRM/Contribute/Form/Contribution/Confirm.php | 12 ++++++++++++ CRM/Contribute/Form/Contribution/Main.php | 8 +++++--- CRM/Contribute/Form/ContributionCharts.php | 2 +- CRM/Contribute/Form/ContributionPage.php | 2 +- CRM/Contribute/Form/ContributionPage/Amount.php | 4 ++-- CRM/Contribute/Form/SoftCredit.php | 3 +++ CRM/Contribute/Form/Task/Invoice.php | 1 + CRM/Core/BAO/CustomGroup.php | 5 ++--- CRM/Core/BAO/Setting.php | 2 +- CRM/Utils/Request.php | 2 +- 11 files changed, 36 insertions(+), 12 deletions(-) diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index e81dc50479..21dee704ab 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -246,6 +246,12 @@ WHERE contribution_id = {$id} /** * This function process contribution related objects. + * + * @param integer $contributionId + * @param integer $statusId + * @param integer|null $previousStatusId + * + * @return null|string */ protected function updateRelatedComponent($contributionId, $statusId, $previousStatusId = NULL) { $statusMsg = NULL; @@ -406,6 +412,7 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co ); // this required to show billing block + // @todo remove this assignment the billing block is now designed to be always included but will not show fieldsets unless those sets of fields are assigned $this->assign_by_ref('paymentProcessor', $paymentProcessor); } diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 1b66484089..4f19a93753 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1486,6 +1486,13 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr /** * Create the recurring contribution record * + * @param CRM_Core_Form $form + * @param array $params + * @param integer $contactID + * @param string $contributionType + * @param bool $online + * + * @return mixed */ static function processRecurringContribution(&$form, &$params, $contactID, $contributionType, $online = TRUE) { // return if this page is not set for recurring @@ -1870,6 +1877,11 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr } } + /** + * @param array $params + * + * @throws CiviCRM_API3_Exception + */ static function submit($params) { $form = new CRM_Contribute_Form_Contribution_Confirm(); $form->_id = $params['id']; diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index a8df7954ce..e92d239e77 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -304,9 +304,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu // to process Custom data that are appended to URL $getDefaults = CRM_Core_BAO_CustomGroup::extractGetParams($this, "'Contact', 'Individual', 'Contribution'"); - if (!empty($getDefaults)) { - $this->_defaults = array_merge($this->_defaults, $getDefaults); - } + $this->_defaults = array_merge($this->_defaults, $getDefaults); $config = CRM_Core_Config::singleton(); // set default country from config if no country set @@ -648,6 +646,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu * build elements to collect information for recurring contributions * * @access public + * + * @param CRM_Core_Form $form */ public static function buildRecur(&$form) { $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionRecur'); @@ -1380,6 +1380,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu /** * Handle Payment Processor switching * For contribution and event registration forms + * @param CRM_Core_Form $form + * @param bool $noFees */ static function preProcessPaymentOptions(&$form, $noFees = FALSE) { $form->_snippet = CRM_Utils_Array::value('snippet', $_GET); diff --git a/CRM/Contribute/Form/ContributionCharts.php b/CRM/Contribute/Form/ContributionCharts.php index 538ad1e7ff..3d40231bce 100644 --- a/CRM/Contribute/Form/ContributionCharts.php +++ b/CRM/Contribute/Form/ContributionCharts.php @@ -202,7 +202,7 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form { elseif ($chartKey == 'by_year') { if (!empty($config->fiscalYearStart) && ($config->fiscalYearStart['M'] != 1 || $config->fiscalYearStart['d'] != 1)) { $startDate = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], substr($index,0,4))); - $endDate = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], substr($index,0,4)+1)); + $endDate = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], (substr($index,0,4)) + 1)); } else { $startDate = CRM_Utils_Date::format(array('Y' => substr($index,0,4))); diff --git a/CRM/Contribute/Form/ContributionPage.php b/CRM/Contribute/Form/ContributionPage.php index 0b3fdd6329..ee47a51890 100644 --- a/CRM/Contribute/Form/ContributionPage.php +++ b/CRM/Contribute/Form/ContributionPage.php @@ -245,7 +245,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form { * * @access public * - * @return void + * @return array defaults */ function setDefaultValues() { //some child classes calling setdefaults directly w/o preprocess. diff --git a/CRM/Contribute/Form/ContributionPage/Amount.php b/CRM/Contribute/Form/ContributionPage/Amount.php index 3a403f4be0..366004c917 100644 --- a/CRM/Contribute/Form/ContributionPage/Amount.php +++ b/CRM/Contribute/Form/ContributionPage/Amount.php @@ -190,7 +190,7 @@ SELECT id * * @access public * - * @return void + * @return array */ function setDefaultValues() { $defaults = parent::setDefaultValues(); @@ -361,7 +361,7 @@ SELECT id } // If Contribution amount section is enabled, then - // Allow other amounts must be enabeld OR the Fixed Contribution + // Allow other amounts must be enabled OR the Fixed Contribution // Contribution options must contain at least one set of values. if (!empty($fields['amount_block_is_active'])) { if (empty($fields['is_allow_other_amount']) && diff --git a/CRM/Contribute/Form/SoftCredit.php b/CRM/Contribute/Form/SoftCredit.php index b8145f7898..962f613e24 100644 --- a/CRM/Contribute/Form/SoftCredit.php +++ b/CRM/Contribute/Form/SoftCredit.php @@ -159,6 +159,9 @@ class CRM_Contribute_Form_SoftCredit { /** * Function used to set defaults for soft credit block + * + * @param $defaults + * @param $form */ static function setDefaultValues(&$defaults, &$form) { //Used to hide/unhide PCP and/or Soft-credit Panes diff --git a/CRM/Contribute/Form/Task/Invoice.php b/CRM/Contribute/Form/Task/Invoice.php index e0a413841f..43cbaa9f28 100644 --- a/CRM/Contribute/Form/Task/Invoice.php +++ b/CRM/Contribute/Form/Task/Invoice.php @@ -655,6 +655,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { * * return $fileName of file which is in pdf format * + * @return string */ static public function putFile($html) { require_once("packages/dompdf/dompdf_config.inc.php"); diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index a3c4b4995e..3ebde84aff 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1531,14 +1531,13 @@ ORDER BY civicrm_custom_group.weight, * @param CRM_Core_Form $form the form object * @param string $type the type of custom group we are using * - * @return void + * @return array * @access public * @static */ static function extractGetParams(&$form, $type) { - // if not GET params return if (empty($_GET)) { - return; + return array(); } $groupTree = CRM_Core_BAO_CustomGroup::getTree($type, $form); diff --git a/CRM/Core/BAO/Setting.php b/CRM/Core/BAO/Setting.php index 45ecdf2ff5..dd8fac1069 100644 --- a/CRM/Core/BAO/Setting.php +++ b/CRM/Core/BAO/Setting.php @@ -205,7 +205,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * * @param null $domainID * - * @return object The data if present in the setting table, else null + * @return mixed The data if present in the setting table, else null * @static * @access public */ diff --git a/CRM/Utils/Request.php b/CRM/Utils/Request.php index eea57653e1..216cf9c324 100644 --- a/CRM/Utils/Request.php +++ b/CRM/Utils/Request.php @@ -59,7 +59,7 @@ class CRM_Utils_Request { * * @param string $name name of the variable to be retrieved * @param string $type type of the variable (see CRM_Utils_Type for details) - * @param stdClass $store session scope where variable is stored + * @param object $store session scope where variable is stored * @param bool $abort is this variable required * @param mixed $default default value of the variable if not present * @param string $method where should we look for the variable -- 2.25.1