Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Fix a bunch of docstrings #11034

Merged
merged 2 commits into from
Nov 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function __construct() {
* @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)) {
Expand Down Expand Up @@ -1424,7 +1424,7 @@ public static function checkDuplicateIds($params) {
*
* @param int $exportMode
* Export mode.
* @param string $componentIds
* @param array $componentIds
* Component ids.
*
* @return array
Expand Down Expand Up @@ -2179,7 +2179,7 @@ public static function contributionCount($contactId, $includeSoftCredit = TRUE)
* @param array $contributionParams
* @param int $paymentProcessorID
*
* @return array
* @return bool
* @throws CiviCRM_API3_Exception
*/
protected static function repeatTransaction(&$contribution, &$input, $contributionParams, $paymentProcessorID) {
Expand Down Expand Up @@ -4299,13 +4299,13 @@ public static function checkTaxAmount($params, $isLineItem = FALSE) {
* @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;';
Expand Down Expand Up @@ -4725,6 +4725,9 @@ public static function sendMail(&$input, &$ids, $contributionID, &$values,

/**
* 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.
Expand Down Expand Up @@ -4875,7 +4878,7 @@ public static function recordPartialPayment($contribution, $params) {
* @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) {
Expand Down Expand Up @@ -4903,7 +4906,7 @@ protected static function getRecurringContributionDescription($contribution, $ev
* for Partially Paid status
*
* @param array $contributions
* @param array $contributionStatusId
* @param string $contributionStatusId
*
*/
public static function addPayments($contributions, $contributionStatusId = NULL) {
Expand Down Expand Up @@ -5221,7 +5224,7 @@ public static function transitionComponentWithReturnMessage($contributionId, $st
*
* @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);
Expand Down Expand Up @@ -5352,6 +5355,7 @@ protected static function isPaymentInstrumentChange(&$params, $pendingStatuses)
* 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
Expand Down Expand Up @@ -5510,10 +5514,10 @@ public static function allowUpdateRevenueRecognitionDate($contributionId) {
*
* @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')) {
Expand Down
6 changes: 3 additions & 3 deletions CRM/Contribute/BAO/ContributionRecur.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static function create(&$params) {
* @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) {
Expand Down Expand Up @@ -628,7 +628,7 @@ public static function addrecurSoftCredit($recurId, $targetContributionId) {
* Add line items for recurring contribution.
*
* @param int $recurId
* @param $contribution
* @param \CRM_Contribute_BAO_Contribution $contribution
*
* @return array
*/
Expand Down Expand Up @@ -746,7 +746,7 @@ public static function updateRecurLinkedPledge($contributionID, $contributionRec
}

/**
* @param $form
* @param CRM_Core_Form $form
*/
public static function recurringContribution(&$form) {
// Recurring contribution fields
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/FinancialTrxn.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public static function getRefundTransactionTrxnID($contributionID) {
* 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');
Expand Down
1 change: 1 addition & 0 deletions CRM/Core/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
* @property string $defaultContactStateProvince
* @property string $monetaryDecimalPoint
* @property string $monetaryThousandSeparator
* @property array fiscalYearStart
*/
class CRM_Core_Config extends CRM_Core_Config_MagicMerge {

Expand Down
1 change: 1 addition & 0 deletions CRM/Event/BAO/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,7 @@ public static function usesPriceSet($id) {
* @param int $participantId
* @param bool $isTest
* @param bool $returnMessageText
* @return array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be array|null ? (it only returns an array depending on the returnMessageText parameter)

*/
public static function sendMail($contactID, &$values, $participantId, $isTest = FALSE, $returnMessageText = FALSE) {

Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/DAO/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down
2 changes: 1 addition & 1 deletion CRM/Financial/BAO/FinancialItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public static function checkContactPresent($contactIds, &$error) {
*
* @param int $entityId
*
* @return object CRM_Core_DAO
* @return array
*/
public static function getPreviousFinancialItem($entityId) {
$params = array(
Expand Down
9 changes: 4 additions & 5 deletions CRM/Member/BAO/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -1145,9 +1145,8 @@ static public function updateRecurMembership(CRM_Member_DAO_Membership $membersh
* 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) {
Expand Down Expand Up @@ -1826,7 +1825,7 @@ public static function linkMembershipPayment($membership, $membershipContributio
* @param int $contactID
* @param int $membershipTypeID
* @param bool $is_test
* @param $changeToday
* @param string $changeToday
* @param int $modifiedID
* @param $customFieldsFormatted
* @param $numRenewTerms
Expand Down Expand Up @@ -2149,7 +2148,7 @@ public function processPriceSet($membershipId, $lineItem) {
* @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) {
Expand Down
2 changes: 1 addition & 1 deletion Civi/Payment/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function singleton() {
* 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
*/
Expand Down