From 81716ddb1da84a4a12a197d55bdef1dbb0eeb0bc Mon Sep 17 00:00:00 2001 From: Elliott Eggleston Date: Wed, 27 Sep 2017 22:05:49 -0500 Subject: [PATCH] Fix a bunch of docstrings --- CRM/Contribute/BAO/Contribution.php | 24 ++++++++++++++---------- CRM/Contribute/BAO/ContributionRecur.php | 6 +++--- CRM/Core/BAO/FinancialTrxn.php | 2 +- CRM/Core/Config.php | 1 + CRM/Event/BAO/Event.php | 1 + CRM/Event/DAO/Participant.php | 2 +- CRM/Financial/BAO/FinancialItem.php | 2 +- CRM/Member/BAO/Membership.php | 9 ++++----- Civi/Payment/System.php | 2 +- 9 files changed, 27 insertions(+), 22 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 8bb11a19e2..398b8a358e 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -97,7 +97,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * @param array $ids * The array that holds all the db ids. * - * @return CRM_Contribute_BAO_Contribution|void + * @return CRM_Contribute_BAO_Contribution|\CRM_Core_Error */ public static function add(&$params, $ids = array()) { if (empty($params)) { @@ -1424,7 +1424,7 @@ WHERE civicrm_contribution.contact_id = civicrm_contact.id * * @param int $exportMode * Export mode. - * @param string $componentIds + * @param array $componentIds * Component ids. * * @return array @@ -2179,7 +2179,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ * @param array $contributionParams * @param int $paymentProcessorID * - * @return array + * @return bool * @throws CiviCRM_API3_Exception */ protected static function repeatTransaction(&$contribution, &$input, $contributionParams, $paymentProcessorID) { @@ -4299,13 +4299,13 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) * @param array $errors * List of errors. * - * @return bool + * @return void */ public static function checkFinancialTypeChange($financialTypeId, $contributionId, &$errors) { if (!empty($financialTypeId)) { $oldFinancialTypeId = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionId, 'financial_type_id'); if ($oldFinancialTypeId == $financialTypeId) { - return FALSE; + return; } } $sql = 'SELECT financial_type_id FROM civicrm_line_item WHERE contribution_id = %1 GROUP BY financial_type_id;'; @@ -4725,6 +4725,9 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) /** * Generate From email and from name in an array values + * @param array $input + * @param \CRM_Contribute_BAO_Contribution $contribution + * @return array */ public static function generateFromEmailAndName($input, $contribution) { // Use input valuse if supplied. @@ -4875,7 +4878,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) * @param CRM_Contribute_BAO_Contribution $contribution * @param CRM_Event_DAO_Event|null $event * - * @return array + * @return string * @throws \CiviCRM_API3_Exception */ protected static function getRecurringContributionDescription($contribution, $event) { @@ -4903,7 +4906,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) * for Partially Paid status * * @param array $contributions - * @param array $contributionStatusId + * @param string $contributionStatusId * */ public static function addPayments($contributions, $contributionStatusId = NULL) { @@ -5221,7 +5224,7 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co * * @param int $contributionID * - * @return array + * @return \CRM_Contribute_BAO_Contribution|null */ private static function getOriginalContribution($contributionID) { return self::getValues(array('id' => $contributionID), CRM_Core_DAO::$_nullArray, CRM_Core_DAO::$_nullArray); @@ -5352,6 +5355,7 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co * Note that the way in which $memberships are loaded as objects is pretty messy & I think we could just * load them in this function. Code clean up would compensate for any minor performance implication. * + * @param \CRM_Contribute_BAO_Contribution $contribution * @param array $memberships * @param int $primaryContributionID * @param string $changeDate @@ -5510,10 +5514,10 @@ LIMIT 1;"; * * @param array $trxnParams * Financial trxn params - * @param string $contributionParams + * @param array $contributionParams * Contribution Params * - * @return string + * @return null */ public static function recordAlwaysAccountsReceivable(&$trxnParams, $contributionParams) { if (!self::checkContributeSettings('always_post_to_accounts_receivable')) { diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php index bb6d30b735..fbe033ebff 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -55,7 +55,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi * @param array $params * (reference ) an assoc array of name/value pairs. * - * @return CRM_Contribute_BAO_Contribution + * @return \CRM_Contribute_BAO_ContributionRecur|\CRM_Core_Error * @todo move hook calls / extended logic to create - requires changing calls to call create not add */ public static function add(&$params) { @@ -628,7 +628,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) * Add line items for recurring contribution. * * @param int $recurId - * @param $contribution + * @param \CRM_Contribute_BAO_Contribution $contribution * * @return array */ @@ -746,7 +746,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) } /** - * @param $form + * @param CRM_Core_Form $form */ public static function recurringContribution(&$form) { // Recurring contribution fields diff --git a/CRM/Core/BAO/FinancialTrxn.php b/CRM/Core/BAO/FinancialTrxn.php index 06f1021d38..7bb1a2cc19 100644 --- a/CRM/Core/BAO/FinancialTrxn.php +++ b/CRM/Core/BAO/FinancialTrxn.php @@ -197,7 +197,7 @@ LIMIT 1;"; * Get the transaction id for the (latest) refund associated with a contribution. * * @param int $contributionID - * @return string + * @return array */ public static function getRefundTransactionIDs($contributionID) { $refundStatusID = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Refunded'); diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index bc567631b8..0aa17a8610 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -64,6 +64,7 @@ require_once 'api/api.php'; * @property string $defaultContactStateProvince * @property string $monetaryDecimalPoint * @property string $monetaryThousandSeparator + * @property array fiscalYearStart */ class CRM_Core_Config extends CRM_Core_Config_MagicMerge { diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index d9a653736e..494dde644a 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1110,6 +1110,7 @@ WHERE civicrm_event.is_active = 1 * @param int $participantId * @param bool $isTest * @param bool $returnMessageText + * @return array */ public static function sendMail($contactID, &$values, $participantId, $isTest = FALSE, $returnMessageText = FALSE) { diff --git a/CRM/Event/DAO/Participant.php b/CRM/Event/DAO/Participant.php index 9142d60ba4..6429ffb100 100644 --- a/CRM/Event/DAO/Participant.php +++ b/CRM/Event/DAO/Participant.php @@ -96,7 +96,7 @@ class CRM_Event_DAO_Participant extends CRM_Core_DAO { * Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that we store the label value and not the key * - * @var text + * @var string */ public $fee_level; /** diff --git a/CRM/Financial/BAO/FinancialItem.php b/CRM/Financial/BAO/FinancialItem.php index 81d6630261..f0b7c54894 100644 --- a/CRM/Financial/BAO/FinancialItem.php +++ b/CRM/Financial/BAO/FinancialItem.php @@ -286,7 +286,7 @@ WHERE cc.id IN (' . implode(',', $contactIds) . ') AND con.is_test = 0'; * * @param int $entityId * - * @return object CRM_Core_DAO + * @return array */ public static function getPreviousFinancialItem($entityId) { $params = array( diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 56376b4161..f2724dd39d 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1145,9 +1145,8 @@ AND civicrm_membership.is_test = %2"; * Reference to the array. * containing all values of * the current membership - * @param array $changeToday - * Array of month, day, year. - * values in case today needs + * @param string $changeToday + * In case today needs * to be customised, null otherwise */ public static function fixMembershipStatusBeforeRenew(&$currentMembership, $changeToday) { @@ -1826,7 +1825,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @param int $contactID * @param int $membershipTypeID * @param bool $is_test - * @param $changeToday + * @param string $changeToday * @param int $modifiedID * @param $customFieldsFormatted * @param $numRenewTerms @@ -2149,7 +2148,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @all bool * if more than one payment associated with membership id need to be returned. * - * @return int + * @return int|int[] * contribution id */ public static function getMembershipContributionId($membershipId, $all = FALSE) { diff --git a/Civi/Payment/System.php b/Civi/Payment/System.php index 1bec2566b0..e5327240f5 100644 --- a/Civi/Payment/System.php +++ b/Civi/Payment/System.php @@ -38,7 +38,7 @@ class System { * Override the config check. This is required in uninstall as no valid instances exist * but will deliberately not work with any valid processors. * - * @return CRM_Core_Payment|NULL + * @return \CRM_Core_Payment|NULL * * @throws \CRM_Core_Exception */ -- 2.25.1