From: Tim Otten Date: Tue, 20 Jan 2015 05:33:26 +0000 (-0800) Subject: INFRA-132 - Misc X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6c552737d30d31187eddb3bea10dafd720bf2a5e;p=civicrm-core.git INFRA-132 - Misc --- diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index bc2815bf86..1d5ecd066e 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -1187,8 +1187,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND $attachments = NULL, $cc = NULL, $bcc = NULL, - // FIXME a param with no default shouldn't be last - $contactIds, + $contactIds = NULL, $additionalDetails = NULL ) { // get the contact details of logged in contact, which we set as from email diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 5dbdc39f04..99d080e344 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -484,8 +484,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { // figure out the file name for activity type, if any if ($this->_activityTypeId && - $this->_activityTypeFile = - CRM_Activity_BAO_Activity::getFileForActivityTypeId($this->_activityTypeId, $this->_crmDir) + $this->_activityTypeFile = CRM_Activity_BAO_Activity::getFileForActivityTypeId($this->_activityTypeId, $this->_crmDir) ) { $this->assign('activityTypeFile', $this->_activityTypeFile); $this->assign('crmDir', $this->_crmDir); @@ -566,8 +565,8 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { $defaults['source_contact_id'] = $this->_sourceContactId; $defaults['target_contact_id'] = $this->_targetContactId; - list($defaults['activity_date_time'], $defaults['activity_date_time_time']) = - CRM_Utils_Date::setDateDefaults(NULL, 'activityDateTime'); + list($defaults['activity_date_time'], $defaults['activity_date_time_time']) + = CRM_Utils_Date::setDateDefaults(NULL, 'activityDateTime'); } if ($this->_activityTypeId) { @@ -1008,7 +1007,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * @param array $params * Associated array of submitted values. * - * @return $this|null|object + * @return self|null|object */ protected function processActivity(&$params) { $activityAssigned = array(); diff --git a/CRM/Activity/Import/Parser.php b/CRM/Activity/Import/Parser.php index fa89d48ba4..02e9257379 100644 --- a/CRM/Activity/Import/Parser.php +++ b/CRM/Activity/Import/Parser.php @@ -278,7 +278,7 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { * Given a list of the importable field keys that the user has selected * set the active fields array to this list * - * @param array mapped array of values + * @param array $fieldKeys * * @return void */ diff --git a/CRM/Batch/BAO/Batch.php b/CRM/Batch/BAO/Batch.php index 23fceb4915..624de900a4 100755 --- a/CRM/Batch/BAO/Batch.php +++ b/CRM/Batch/BAO/Batch.php @@ -299,8 +299,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { $newLinks = array(); } elseif ($params['context'] == 'financialBatch') { - $values['check'] = - "id . "' name='check_" . $object->id . @@ -673,34 +672,33 @@ LEFT JOIN civicrm_contact contact_a ON contact_a.id = civicrm_contribution.conta LEFT JOIN civicrm_contribution_soft ON civicrm_contribution_soft.contribution_id = civicrm_contribution.id "; - $searchFields = - array( - 'sort_name', - 'financial_type_id', - 'contribution_page_id', - 'contribution_payment_instrument_id', - 'contribution_transaction_id', - 'contribution_source', - 'contribution_currency_type', - 'contribution_pay_later', - 'contribution_recurring', - 'contribution_test', - 'contribution_thankyou_date_is_not_null', - 'contribution_receipt_date_is_not_null', - 'contribution_pcp_made_through_id', - 'contribution_pcp_display_in_roll', - 'contribution_date_relative', - 'contribution_amount_low', - 'contribution_amount_high', - 'contribution_in_honor_of', - 'contact_tags', - 'group', - 'contribution_date_relative', - 'contribution_date_high', - 'contribution_date_low', - 'contribution_check_number', - 'contribution_status_id', - ); + $searchFields = array( + 'sort_name', + 'financial_type_id', + 'contribution_page_id', + 'contribution_payment_instrument_id', + 'contribution_transaction_id', + 'contribution_source', + 'contribution_currency_type', + 'contribution_pay_later', + 'contribution_recurring', + 'contribution_test', + 'contribution_thankyou_date_is_not_null', + 'contribution_receipt_date_is_not_null', + 'contribution_pcp_made_through_id', + 'contribution_pcp_display_in_roll', + 'contribution_date_relative', + 'contribution_amount_low', + 'contribution_amount_high', + 'contribution_in_honor_of', + 'contact_tags', + 'group', + 'contribution_date_relative', + 'contribution_date_high', + 'contribution_date_low', + 'contribution_check_number', + 'contribution_status_id', + ); $values = array(); foreach ($searchFields as $field) { if (isset($params[$field])) { diff --git a/CRM/Campaign/Form/Survey/TabHeader.php b/CRM/Campaign/Form/Survey/TabHeader.php index a55741d619..78f3b2d789 100644 --- a/CRM/Campaign/Form/Survey/TabHeader.php +++ b/CRM/Campaign/Form/Survey/TabHeader.php @@ -164,8 +164,9 @@ class CRM_Campaign_Form_Survey_TabHeader { */ public static function getNextTab(&$form) { static $next = FALSE; - if ($next) + if ($next) { return $next; + } $tabs = $form->get('tabHeader'); if (is_array($tabs)) { diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index e556aa0690..f6b59effc6 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -536,8 +536,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); public function createDefaultCrudLink($crudLinkSpec) { switch ($crudLinkSpec['action']) { case CRM_Core_Action::VIEW: - - return array( + $result = array( 'title' => $this->display_name, 'path' => 'civicrm/contact/view', 'query' => array( @@ -545,9 +544,10 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); 'cid' => $this->id, ), ); + return $result; case CRM_Core_Action::UPDATE: - return array( + $result = array( 'title' => $this->display_name, 'path' => 'civicrm/contact/add', 'query' => array( @@ -556,6 +556,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); 'cid' => $this->id, ), ); + return $result; } return NULL; } @@ -1624,10 +1625,10 @@ WHERE id={$id}; "; // We don't know the contents of return properties, but we need the lower // level ids of the contact so add a few fields. - $returnProperties['first_name'] = - $returnProperties['organization_name'] = - $returnProperties['household_name'] = - $returnProperties['contact_type'] = + $returnProperties['first_name'] = 1; + $returnProperties['organization_name'] = 1; + $returnProperties['household_name'] = 1; + $returnProperties['contact_type'] = 1; $returnProperties['contact_sub_type'] = 1; return list($query, $options) = CRM_Contact_BAO_Query::apiQuery($params, $returnProperties, $options); } @@ -2556,11 +2557,11 @@ AND civicrm_openid.is_primary = 1"; return CRM_Core_BAO_EntityTag::getContactTags($contactId, TRUE); case 'rel': - - return CRM_Contact_BAO_Relationship::getRelationship($contactId, + $result = CRM_Contact_BAO_Relationship::getRelationship($contactId, CRM_Contact_BAO_Relationship::CURRENT, 0, 1 ); + return $result; case 'group': diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 60d15129f9..e645f4c096 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -515,8 +515,6 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { $this->where_tables = serialize($whereTables); } } - - return; } /** diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 7e6ef24df5..eae321ae39 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -498,11 +498,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { // make we require one primary block, CRM-5505 if ($updateMode) { if (!$hasPrimary) { - $hasPrimary = - CRM_Utils_Array::value( - 'is_primary', - CRM_Utils_Array::value($instance, $defaults[$name]) - ); + $hasPrimary = CRM_Utils_Array::value( + 'is_primary', + CRM_Utils_Array::value($instance, $defaults[$name]) + ); } continue; } diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index de9472fcc3..5c18365737 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -406,8 +406,6 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { } } } - - return; } /** diff --git a/CRM/Contact/Form/Task/Label.php b/CRM/Contact/Form/Task/Label.php index a0c77f777d..039069e3e1 100644 --- a/CRM/Contact/Form/Task/Label.php +++ b/CRM/Contact/Form/Task/Label.php @@ -92,8 +92,6 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task { /** * Set default values for the form. * - * @param null - * * @return array * array of default values */ diff --git a/CRM/Contribute/Form/Task/PDFLetterCommon.php b/CRM/Contribute/Form/Task/PDFLetterCommon.php index a66c3e6857..f081e32b5f 100644 --- a/CRM/Contribute/Form/Task/PDFLetterCommon.php +++ b/CRM/Contribute/Form/Task/PDFLetterCommon.php @@ -144,7 +144,6 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF if (isset($tokens[$entity]) && is_array($tokens[$entity])) { foreach ($tokens[$entity] as $token) { if (!self::isHtmlTokenInTableCell($token, $entity, $html)) { - ; return FALSE; } } diff --git a/CRM/Core/BAO/Address.php b/CRM/Core/BAO/Address.php index cafff343e5..342486dc62 100644 --- a/CRM/Core/BAO/Address.php +++ b/CRM/Core/BAO/Address.php @@ -364,15 +364,14 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { CRM_Utils_Address_USPS::checkAddress($params); // do street parsing again if enabled, since street address might have changed - $parseStreetAddress = - CRM_Utils_Array::value( - 'street_address_parsing', - CRM_Core_BAO_Setting::valueOptions( - CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, - 'address_options' - ), - FALSE - ); + $parseStreetAddress = CRM_Utils_Array::value( + 'street_address_parsing', + CRM_Core_BAO_Setting::valueOptions( + CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, + 'address_options' + ), + FALSE + ); if ($parseStreetAddress && !empty($params['street_address'])) { foreach (array( @@ -711,8 +710,10 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC, * NB: civic street formats for en_CA and fr_CA used by default if those locales are active * otherwise en_US format is default action * - * @param string Street address including number and apt - * @param string Locale - to set locale used to parse address + * @param string $streetAddress + * Street address including number and apt. + * @param string $locale + * Locale used to parse address. * * @return array * parsed fields values. @@ -893,11 +894,10 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC, public static function validateAddressOptions($fields) { static $addressOptions = NULL; if (!$addressOptions) { - $addressOptions = - CRM_Core_BAO_Setting::valueOptions( - CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, - 'address_options' - ); + $addressOptions = CRM_Core_BAO_Setting::valueOptions( + CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, + 'address_options' + ); } if (is_array($fields) && !empty($fields)) { @@ -1033,8 +1033,11 @@ SELECT is_primary, $uniqueAddress = array(); foreach (array_keys($rows) as $rowID) { // load complete address as array key - $address = - trim($rows[$rowID]['street_address']) . trim($rows[$rowID]['city']) . trim($rows[$rowID]['state_province']) . trim($rows[$rowID]['postal_code']) . trim($rows[$rowID]['country']); + $address = trim($rows[$rowID]['street_address']) + . trim($rows[$rowID]['city']) + . trim($rows[$rowID]['state_province']) + . trim($rows[$rowID]['postal_code']) + . trim($rows[$rowID]['country']); if (isset($rows[$rowID]['last_name'])) { $name = $rows[$rowID]['last_name']; } diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 8bd142da0a..c923c542ac 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -63,8 +63,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { /** * Build and retrieve the list of data types and descriptions * - * @param NULL - * * @return array * Data type => Description */ @@ -1609,7 +1607,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { ); if (!array_key_exists($customFieldId, $customFields)) { - return; + return NULL; } // return if field is a 'code' field diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 0cee4a3381..98aa0b6321 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -80,8 +80,7 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup { $params['extends'][0] == 'ParticipantEventName' || $params['extends'][0] == 'ParticipantEventType' ) { - $group->extends_entity_column_id = - CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $params['extends'][0], 'value', 'name'); + $group->extends_entity_column_id = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $params['extends'][0], 'value', 'name'); } //this is format when form get submit. @@ -274,9 +273,7 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup { $dao = new CRM_Core_DAO_CustomGroup(); $dao->extends = $extends; $dao->extends_entity_column_id = $columnId; - $escapedValue = - CRM_Core_DAO::VALUE_SEPARATOR . CRM_Core_DAO::escapeString($columnValue) . - CRM_Core_DAO::VALUE_SEPARATOR; + $escapedValue = CRM_Core_DAO::VALUE_SEPARATOR . CRM_Core_DAO::escapeString($columnValue) . CRM_Core_DAO::VALUE_SEPARATOR; $dao->whereAdd("extends_entity_column_value LIKE \"%$escapedValue%\""); //$dao->extends_entity_column_value = $columnValue; return $dao->find() ? TRUE : FALSE; @@ -517,8 +514,7 @@ ORDER BY civicrm_custom_group.weight, } $cacheKey = "CRM_Core_DAO_CustomGroup_Query " . md5($cacheString); - $multipleFieldGroupCacheKey = - "CRM_Core_DAO_CustomGroup_QueryMultipleFields " . md5($cacheString); + $multipleFieldGroupCacheKey = "CRM_Core_DAO_CustomGroup_QueryMultipleFields " . md5($cacheString); $cache = CRM_Utils_Cache::singleton(); $tablesWithEntityData = array(); if ($fromCache) { @@ -827,12 +823,9 @@ ORDER BY civicrm_custom_group.weight, 'entity_id', 'file_id' ); - $customValue['imageURL'] = - str_replace('persist/contribute', 'custom', $config->imageUploadURL) . + $customValue['imageURL'] = str_replace('persist/contribute', 'custom', $config->imageUploadURL) . $fileDAO->uri; - list($path) = CRM_Core_BAO_File::path($fileDAO->id, $entityId, - NULL, NULL - ); + list($path) = CRM_Core_BAO_File::path($fileDAO->id, $entityId, NULL, NULL); if ($path && file_exists($path)) { list($imageWidth, $imageHeight) = getimagesize($path); list($imageThumbWidth, $imageThumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($imageWidth, $imageHeight); @@ -1169,11 +1162,11 @@ ORDER BY civicrm_custom_group.weight, * Add the whereAdd clause for the DAO depending on the type of entity * the custom group is extending. * - * @param $customGroupDAO + * @param object $customGroupDAO * @param string $entityType * What entity are we extending here ?. * - * @param object CRM_Core_DAO_CustomGroup (reference) - Custom Group DAO. + * @param int $entityID * @param bool $allSubtypes * * @return void @@ -1461,10 +1454,9 @@ ORDER BY civicrm_custom_group.weight, case 'CheckBox': if (!empty($v)) { $customValue = array_keys($v); - $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = - CRM_Core_DAO::VALUE_SEPARATOR . - implode(CRM_Core_DAO::VALUE_SEPARATOR, $customValue) . - CRM_Core_DAO::VALUE_SEPARATOR; + $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = CRM_Core_DAO::VALUE_SEPARATOR + . implode(CRM_Core_DAO::VALUE_SEPARATOR, $customValue) + . CRM_Core_DAO::VALUE_SEPARATOR; } else { $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = NULL; @@ -1477,10 +1469,9 @@ ORDER BY civicrm_custom_group.weight, //added for Multi-Select case 'Multi-Select': if (!empty($v)) { - $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = - CRM_Core_DAO::VALUE_SEPARATOR . - implode(CRM_Core_DAO::VALUE_SEPARATOR, $v) . - CRM_Core_DAO::VALUE_SEPARATOR; + $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = CRM_Core_DAO::VALUE_SEPARATOR + . implode(CRM_Core_DAO::VALUE_SEPARATOR, $v) + . CRM_Core_DAO::VALUE_SEPARATOR; } else { $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = NULL; @@ -1802,7 +1793,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1, * @param array $groupTree * @param int $groupCount * Group count by default 1, but can varry for multiple value custom data. - * @param object form object + * @param object $form * * @return array */ diff --git a/CRM/Core/BAO/Phone.php b/CRM/Core/BAO/Phone.php index 32ea5c9be1..14cd04f52c 100644 --- a/CRM/Core/BAO/Phone.php +++ b/CRM/Core/BAO/Phone.php @@ -90,7 +90,7 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone { * Given the list of params in the params array, fetch the object * and store the values in the values array * - * @param array entityBlock input parameters to find object + * @param array $entityBlock * * @return array * array of phone objects diff --git a/CRM/Core/BAO/Setting.php b/CRM/Core/BAO/Setting.php index ada8d3eecc..f42e66c6f9 100644 --- a/CRM/Core/BAO/Setting.php +++ b/CRM/Core/BAO/Setting.php @@ -304,15 +304,14 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { } } else { - $setting = - CRM_Core_BAO_Setting::getItem( - $fields['values'][$name]['group_name'], - $name, - CRM_Utils_Array::value('component_id', $params), - NULL, - CRM_Utils_Array::value('contact_id', $params), - $domainID - ); + $setting = CRM_Core_BAO_Setting::getItem( + $fields['values'][$name]['group_name'], + $name, + CRM_Utils_Array::value('component_id', $params), + NULL, + CRM_Utils_Array::value('contact_id', $params), + $domainID + ); } if (!is_null($setting)) { // we won't return if not set - helps in return all scenario - otherwise we can't indentify the missing ones diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 7d868d1916..b68f8fef65 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -502,10 +502,11 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * Add default Next / Back buttons * - * @param array array of associative arrays in the order in which the buttons should be - * displayed. The associate array has 3 fields: 'type', 'name' and 'isDefault' - * The base form class will define a bunch of static arrays for commonly used - * formats + * @param array $params + * Array of associative arrays in the order in which the buttons should be + * displayed. The associate array has 3 fields: 'type', 'name' and 'isDefault' + * The base form class will define a bunch of static arrays for commonly used + * formats. * * @return void */ @@ -620,7 +621,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * Setter function for options * - * @param mixed + * @param mixed $options * * @return void */ @@ -661,7 +662,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * Setter function for Form Action * - * @param string + * @param string $action * * @return void */ @@ -763,9 +764,10 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * Store the variable with the value in the form scope * - * @param string name : name of the variable - * @param mixed value : value of the variable - * + * @param string $name + * Name of the variable. + * @param mixed $value + * Value of the variable. * * @return void */ @@ -776,8 +778,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * Get the variable from the form scope * - * @param string name : name of the variable - * + * @param string $name + * Name of the variable * * @return mixed */ diff --git a/CRM/Core/Form/RecurringEntity.php b/CRM/Core/Form/RecurringEntity.php index 743b5baadb..40f96a5b46 100644 --- a/CRM/Core/Form/RecurringEntity.php +++ b/CRM/Core/Form/RecurringEntity.php @@ -369,28 +369,26 @@ class CRM_Core_Form_RecurringEntity { if ($optionGroupIdExists) { CRM_Core_BAO_OptionGroup::del($optionGroupIdExists); } - $optionGroupParams = - array( - 'name' => $type . '_repeat_exclude_dates_' . $actionScheduleObj->entity_value, - 'title' => $type . ' recursion', - 'is_reserved' => 0, - 'is_active' => 1, - ); + $optionGroupParams = array( + 'name' => $type . '_repeat_exclude_dates_' . $actionScheduleObj->entity_value, + 'title' => $type . ' recursion', + 'is_reserved' => 0, + 'is_active' => 1, + ); $opGroup = CRM_Core_BAO_OptionGroup::add($optionGroupParams); if ($opGroup->id) { $oldWeight = 0; $fieldValues = array('option_group_id' => $opGroup->id); foreach ($excludeDates as $val) { - $optionGroupValue = - array( - 'option_group_id' => $opGroup->id, - 'label' => CRM_Utils_Date::processDate($val), - 'value' => CRM_Utils_Date::processDate($val), - 'name' => $opGroup->name, - 'description' => 'Used for recurring ' . $type, - 'weight' => CRM_Utils_Weight::updateOtherWeights('CRM_Core_DAO_OptionValue', $oldWeight, CRM_Utils_Array::value('weight', $params), $fieldValues), - 'is_active' => 1, - ); + $optionGroupValue = array( + 'option_group_id' => $opGroup->id, + 'label' => CRM_Utils_Date::processDate($val), + 'value' => CRM_Utils_Date::processDate($val), + 'name' => $opGroup->name, + 'description' => 'Used for recurring ' . $type, + 'weight' => CRM_Utils_Weight::updateOtherWeights('CRM_Core_DAO_OptionValue', $oldWeight, CRM_Utils_Array::value('weight', $params), $fieldValues), + 'is_active' => 1, + ); $excludeDateList[] = $optionGroupValue['value']; CRM_Core_BAO_OptionValue::add($optionGroupValue); } diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index dd66874cd2..f461bf693b 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -167,7 +167,7 @@ class CRM_Core_Payment_BaseIPN { CRM_Core_Error::debug_log_message($e->getMessage()); } if (!empty($error_handling['echo_error'])) { - echo($e->getMessage()); + echo $e->getMessage(); } if (!empty($error_handling['return_error'])) { return array( diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 4404f71034..4a3be6df74 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -248,8 +248,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { //$args['desc'] = 'Recurring Contribution'; $args['totalbillingcycles'] = $params['installments']; $args['version'] = '56.0'; - $args['profilereference'] = - "i={$params['invoiceID']}" . + $args['profilereference'] = "i={$params['invoiceID']}" . "&m=$component" . "&c={$params['contactID']}" . "&r={$params['contributionRecurID']}" . @@ -335,7 +334,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $args['billingfrequency'] = $params['frequency_interval']; $args['method'] = "CreateRecurringPaymentsProfile"; $args['profilestartdate'] = $start_date; - $args['desc'] = + $args['desc'] = "" . $params['description'] . ": " . $params['amount'] . " Per " . $params['frequency_interval'] . " " . @@ -343,7 +342,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $args['amt'] = $params['amount']; $args['totalbillingcycles'] = $params['installments']; $args['version'] = 56.0; - $args['PROFILEREFERENCE'] = + $args['PROFILEREFERENCE'] = "" . "i=" . $params['invoiceID'] . "&m=" . $component . "&c=" . $params['contactID'] . "&r=" . $params['contributionRecurID'] . "&b=" . $params['contributionID'] . "&p=" . $params['contributionPageID']; diff --git a/CRM/Core/Payment/PaymentExpress.php b/CRM/Core/Payment/PaymentExpress.php index 91c3b2f6bd..0aba51b29e 100644 --- a/CRM/Core/Payment/PaymentExpress.php +++ b/CRM/Core/Payment/PaymentExpress.php @@ -128,10 +128,6 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { * * @param array $params * Assoc array of input parameters for this transaction. - * - * @return array|NULL - * the result in an nice formatted array (or an error object) - * @abstract */ public function doDirectPayment(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); diff --git a/CRM/Core/Permission/WordPress.php b/CRM/Core/Permission/WordPress.php index 97cbf01c1b..fd93f5f9ea 100644 --- a/CRM/Core/Permission/WordPress.php +++ b/CRM/Core/Permission/WordPress.php @@ -102,7 +102,6 @@ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base { * @inheritDoc */ public function upgradePermissions($permissions) { - return; } } diff --git a/CRM/Core/Selector/API.php b/CRM/Core/Selector/API.php index 782eb28908..cc9544bca8 100644 --- a/CRM/Core/Selector/API.php +++ b/CRM/Core/Selector/API.php @@ -51,8 +51,10 @@ interface CRM_Core_Selector_API { * csvString - The html string to display for export as csv * rowCount - the number of rows to be included * - * @param string action the action being performed - * @param array params the array that the pagerParams will be inserted into + * @param string $action + * The action being performed. + * @param array $params + * The array that the pagerParams will be inserted into. * * @return void */ @@ -61,7 +63,8 @@ interface CRM_Core_Selector_API { /** * Returns the sort order array for the given action * - * @param string action the action being performed + * @param string $action + * The action being performed. * * @return array * the elements that can be sorted along with their properties @@ -85,7 +88,8 @@ interface CRM_Core_Selector_API { /** * Returns the number of rows for this action * - * @param string action the action being performed + * @param string $action + * The action being performed. * * @return int * the total number of rows for this action @@ -124,7 +128,8 @@ interface CRM_Core_Selector_API { /** * Return the filename for the exported CSV * - * @param string type the type of export required: csv/xml/foaf etc + * @param string $type + * The type of export required: csv/xml/foaf etc. * * @return string * the fileName which we will munge to skip spaces and diff --git a/CRM/Core/Smarty/plugins/modifier.substring.php b/CRM/Core/Smarty/plugins/modifier.substring.php index 8c6cd75059..7187541b06 100644 --- a/CRM/Core/Smarty/plugins/modifier.substring.php +++ b/CRM/Core/Smarty/plugins/modifier.substring.php @@ -48,12 +48,12 @@ * {$my_string|substring:2:4} * returns substring from character 2 until character 6 * @link based on substr(): http://www.zend.com/manual/function.substr.php - * @param string - * @param position: startposition of the substring, beginning with 0 - * @param length: length of substring + * @param string $string + * @param int $position + * startposition of the substring, beginning with 0 + * @param int $length + * length of substring * @return string - * - * ------------------------------------------------------------- */ function smarty_modifier_substring($string, $position, $length) { return substr($string, $position, $length); diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 6c49c109fe..d324b1e9e9 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -712,11 +712,9 @@ GROUP BY participant.event_id $extIdentifier = CRM_Utils_Array::value('external_identifier', $contactFields); if ($extIdentifier) { $tmpContactField['external_identifier'] = $extIdentifier; - $tmpContactField['external_identifier']['title'] = - CRM_Utils_Array::value('title', $extIdentifier) . ' (match to contact)'; + $tmpContactField['external_identifier']['title'] = CRM_Utils_Array::value('title', $extIdentifier) . ' (match to contact)'; } - $tmpFields['participant_contact_id']['title'] = - $tmpFields['participant_contact_id']['title'] . ' (match to contact)'; + $tmpFields['participant_contact_id']['title'] = $tmpFields['participant_contact_id']['title'] . ' (match to contact)'; $fields = array_merge($fields, $tmpContactField); $fields = array_merge($fields, $tmpFields); @@ -1811,14 +1809,16 @@ WHERE cpf.price_set_id = %1 AND cpfv.label LIKE %2"; $contributionParams['contribution']->financial_type_id, $relationTypeId); if (!empty($contributionParams['trxnParams']['from_financial_account_id'])) { $contributionParams['trxnParams']['total_amount'] = $mainAmount - $contributionParams['total_amount']; - $contributionParams['trxnParams']['payment_processor_id'] = $contributionParams['trxnParams']['payment_instrument_id'] = - $contributionParams['trxnParams']['check_number'] = $contributionParams['trxnParams']['trxn_id'] = - $contributionParams['trxnParams']['net_amount'] = $contributionParams['trxnParams']['fee_amount'] = NULL; + $contributionParams['trxnParams']['payment_processor_id'] = NULL; + $contributionParams['trxnParams']['payment_instrument_id'] = NULL; + $contributionParams['trxnParams']['check_number'] = NULL; + $contributionParams['trxnParams']['trxn_id'] = NULL; + $contributionParams['trxnParams']['net_amount'] = NULL; + $contributionParams['trxnParams']['fee_amount'] = NULL; CRM_Core_BAO_FinancialTrxn::create($contributionParams['trxnParams']); } } - return; } /** @@ -2087,8 +2087,11 @@ WHERE (li.entity_table = 'civicrm_participant' AND li.entity_id = {$participantI $ftDetail = CRM_Core_BAO_FinancialTrxn::getBalanceTrxnAmt($contributionId); // adjusted amount financial_trxn creation if (empty($ftDetail['trxn_id'])) { - $updatedContribution = - CRM_Contribute_BAO_Contribution::getValues(array('id' => $contributionId), CRM_Core_DAO::$_nullArray, CRM_Core_DAO::$_nullArray); + $updatedContribution = CRM_Contribute_BAO_Contribution::getValues( + array('id' => $contributionId), + CRM_Core_DAO::$_nullArray, + CRM_Core_DAO::$_nullArray + ); $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Accounts Receivable Account is' ")); $toFinancialAccount = CRM_Contribute_PseudoConstant::financialAccountType($updatedContribution->financial_type_id, $relationTypeId); diff --git a/CRM/Event/Cart/BAO/Cart.php b/CRM/Event/Cart/BAO/Cart.php index 43cf2b20fc..f0166b7185 100644 --- a/CRM/Event/Cart/BAO/Cart.php +++ b/CRM/Event/Cart/BAO/Cart.php @@ -101,7 +101,7 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { } /** - * @return $this|bool|CRM_Event_Cart_BAO_Cart + * @return self|bool|CRM_Event_Cart_BAO_Cart */ public static function find_or_create_for_current_session() { $session = CRM_Core_Session::singleton(); diff --git a/CRM/Grant/Form/Grant.php b/CRM/Grant/Form/Grant.php index 780fe1f518..4428b7d63a 100644 --- a/CRM/Grant/Form/Grant.php +++ b/CRM/Grant/Form/Grant.php @@ -74,8 +74,7 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); $this->_grantType = NULL; if ($this->_id) { - $this->_grantType = - CRM_Core_DAO::getFieldValue('CRM_Grant_DAO_Grant', $this->_id, 'grant_type_id'); + $this->_grantType = CRM_Core_DAO::getFieldValue('CRM_Grant_DAO_Grant', $this->_id, 'grant_type_id'); } $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); diff --git a/CRM/Mailing/BAO/Query.php b/CRM/Mailing/BAO/Query.php index 174a829ae6..7b3da4e6f7 100644 --- a/CRM/Mailing/BAO/Query.php +++ b/CRM/Mailing/BAO/Query.php @@ -64,8 +64,8 @@ class CRM_Mailing_BAO_Query { $query->_element['mailing_id'] = 1; // base table is contact, so join recipients to it - $query->_tables['civicrm_mailing_recipients'] = $query->_whereTables['civicrm_mailing_recipients'] = - " INNER JOIN civicrm_mailing_recipients ON civicrm_mailing_recipients.contact_id = contact_a.id "; + $query->_tables['civicrm_mailing_recipients'] = $query->_whereTables['civicrm_mailing_recipients'] + = " INNER JOIN civicrm_mailing_recipients ON civicrm_mailing_recipients.contact_id = contact_a.id "; $query->_tables['civicrm_mailing'] = $query->_whereTables['civicrm_mailing'] = 1; @@ -83,8 +83,8 @@ class CRM_Mailing_BAO_Query { // get mailing status if (!empty($query->_returnProperties['mailing_job_status'])) { - $query->_tables['civicrm_mailing_job'] = $query->_whereTables['civicrm_mailing_job'] = - " LEFT JOIN civicrm_mailing_job ON civicrm_mailing_job.mailing_id = civicrm_mailing.id AND civicrm_mailing_job.parent_id IS NULL AND civicrm_mailing_job.is_test != 1 "; + $query->_tables['civicrm_mailing_job'] = $query->_whereTables['civicrm_mailing_job'] + = " LEFT JOIN civicrm_mailing_job ON civicrm_mailing_job.mailing_id = civicrm_mailing.id AND civicrm_mailing_job.parent_id IS NULL AND civicrm_mailing_job.is_test != 1 "; $query->_select['mailing_job_status'] = "civicrm_mailing_job.status as mailing_job_status"; $query->_element['mailing_job_status'] = 1; } @@ -111,8 +111,8 @@ class CRM_Mailing_BAO_Query { // mailing job end date / completed date if (!empty($query->_returnProperties['mailing_job_end_date'])) { - $query->_tables['civicrm_mailing_job'] = $query->_whereTables['civicrm_mailing_job'] = - " LEFT JOIN civicrm_mailing_job ON civicrm_mailing_job.mailing_id = civicrm_mailing.id AND civicrm_mailing_job.parent_id IS NULL AND civicrm_mailing_job.is_test != 1 "; + $query->_tables['civicrm_mailing_job'] = $query->_whereTables['civicrm_mailing_job'] + = " LEFT JOIN civicrm_mailing_job ON civicrm_mailing_job.mailing_id = civicrm_mailing.id AND civicrm_mailing_job.parent_id IS NULL AND civicrm_mailing_job.is_test != 1 "; $query->_select['mailing_job_end_date'] = "civicrm_mailing_job.end_date as mailing_job_end_date"; $query->_element['mailing_job_end_date'] = 1; } diff --git a/CRM/Member/Form/Task/Label.php b/CRM/Member/Form/Task/Label.php index ad1b027c48..5742c0b6c2 100644 --- a/CRM/Member/Form/Task/Label.php +++ b/CRM/Member/Form/Task/Label.php @@ -64,8 +64,6 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task { /** * Set default values for the form. * - * @param null - * * @return array * array of default values */ diff --git a/CRM/Price/Page/Option.php b/CRM/Price/Page/Option.php index ba38011383..3c8898f2a1 100644 --- a/CRM/Price/Page/Option.php +++ b/CRM/Price/Page/Option.php @@ -76,8 +76,6 @@ class CRM_Price_Page_Option extends CRM_Core_Page { /** * Get the action links for this page. * - * @param null - * * @return array * array of action links that we need to display for the browse screen */ @@ -120,8 +118,6 @@ class CRM_Price_Page_Option extends CRM_Core_Page { /** * Browse all price fields. * - * @param null - * * @return void */ public function browse() { @@ -255,12 +251,9 @@ class CRM_Price_Page_Option extends CRM_Core_Page { * This method is called after the page is created. It checks for the * type of action and executes that action. * - * @param null - * * @return void */ public function run() { - // get the field id $this->_fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE, 0 diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 995ec03b28..9314b1f1f0 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -1333,7 +1333,7 @@ class CRM_Report_Form extends CRM_Core_Form { case CRM_Report_Form::OP_INT: case CRM_Report_Form::OP_FLOAT: - return array( + $result = array( 'lte' => ts('Is less than or equal to'), 'gte' => ts('Is greater than or equal to'), 'bw' => ts('Is between'), @@ -1345,39 +1345,44 @@ class CRM_Report_Form extends CRM_Core_Form { 'nll' => ts('Is empty (Null)'), 'nnll' => ts('Is not empty (Null)'), ); + return $result; case CRM_Report_Form::OP_SELECT: - return array( + $result = array( 'eq' => ts('Is equal to'), ); + return $result; case CRM_Report_Form::OP_MONTH: case CRM_Report_Form::OP_MULTISELECT: case CRM_Report_Form::OP_ENTITYREF: - return array( + $result = array( 'in' => ts('Is one of'), 'notin' => ts('Is not one of'), ); + return $result; case CRM_Report_Form::OP_DATE: - return array( + $result = array( 'nll' => ts('Is empty (Null)'), 'nnll' => ts('Is not empty (Null)'), ); + return $result; case CRM_Report_Form::OP_MULTISELECT_SEPARATOR: // use this operator for the values, concatenated with separator. For e.g if // multiple options for a column is stored as ^A{val1}^A{val2}^A - return array( + $result = array( 'mhas' => ts('Is one of'), 'mnot' => ts('Is not one of'), ); + return $result; default: // type is string - return array( + $result = array( 'has' => ts('Contains'), 'sw' => ts('Starts with'), 'ew' => ts('Ends with'), @@ -1387,6 +1392,7 @@ class CRM_Report_Form extends CRM_Core_Form { 'nll' => ts('Is empty (Null)'), 'nnll' => ts('Is not empty (Null)'), ); + return $result; } } diff --git a/CRM/Report/Form/Activity.php b/CRM/Report/Form/Activity.php index 1583964c24..bd7ca05529 100644 --- a/CRM/Report/Form/Activity.php +++ b/CRM/Report/Form/Activity.php @@ -564,8 +564,7 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { empty($this->_params['activity_type_id_value']) ) { $actTypes = array_flip(CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'label', TRUE)); - $clause = - "( {$this->_aliases['civicrm_activity']}.activity_type_id IN (" . + $clause = "( {$this->_aliases['civicrm_activity']}.activity_type_id IN (" . implode(',', $actTypes) . ") )"; } } diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php index e09cb847df..d012d3edc3 100644 --- a/CRM/Report/Form/Contribute/Detail.php +++ b/CRM/Report/Form/Contribute/Detail.php @@ -468,8 +468,7 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { $dao = CRM_Core_DAO::executeQuery($sql); while ($dao->fetch()) { - $totalAmount[] = - CRM_Utils_Money::format($dao->amount, $dao->currency) . " (" . + $totalAmount[] = CRM_Utils_Money::format($dao->amount, $dao->currency) . " (" . $dao->count . ")"; $average[] = CRM_Utils_Money::format($dao->avg, $dao->currency); $count += $dao->count; @@ -507,8 +506,7 @@ SELECT COUNT(contribution_soft_civireport.amount ) as count, GROUP BY {$this->_aliases['civicrm_contribution']}.currency"; $dao = CRM_Core_DAO::executeQuery($sql); while ($dao->fetch()) { - $totalAmount[] = - CRM_Utils_Money::format($dao->amount, $dao->currency) . " (" . + $totalAmount[] = CRM_Utils_Money::format($dao->amount, $dao->currency) . " (" . $dao->count . ")"; $average[] = CRM_Utils_Money::format($dao->avg, $dao->currency); $count += $dao->count; @@ -550,8 +548,7 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency"; // 1. use main contribution query to build temp table 1 $sql = $this->buildQuery(); - $tempQuery = - 'CREATE TEMPORARY TABLE civireport_contribution_detail_temp1 AS ' . $sql; + $tempQuery = 'CREATE TEMPORARY TABLE civireport_contribution_detail_temp1 AS ' . $sql; CRM_Core_DAO::executeQuery($tempQuery); $this->setPager(); @@ -565,8 +562,7 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency"; $select = str_ireplace("'Contribution' as", "'Soft Credit' as", $select); // we inner join with temp1 to restrict soft contributions to those in temp1 table $sql = "{$select} {$this->_from} {$this->_where} {$this->_groupBy}"; - $tempQuery = - 'CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS ' . $sql; + $tempQuery = 'CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS ' . $sql; CRM_Core_DAO::executeQuery($tempQuery); if (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) == 'soft_credits_only' diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index 5361a4e22a..9cd7d364df 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -314,8 +314,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { } if (!empty($this->_params['group_bys_freq'][$fieldName])) { $this->_interval = $field['title']; - $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['title'] = - $field['title'] . ' Beginning'; + $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['title'] = $field['title'] . ' Beginning'; $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['type'] = $field['type']; $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['group_by'] = $this->_params['group_bys_freq'][$fieldName]; @@ -544,15 +543,15 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_ $totalAmount = $average = $softTotalAmount = $softAverage = array(); $count = $softCount = 0; while ($dao->fetch()) { - $totalAmount[] = - CRM_Utils_Money::format($dao->civicrm_contribution_total_amount_sum, $dao->currency) . + $totalAmount[] + = CRM_Utils_Money::format($dao->civicrm_contribution_total_amount_sum, $dao->currency) . " (" . $dao->civicrm_contribution_total_amount_count . ")"; $average[] = CRM_Utils_Money::format($dao->civicrm_contribution_total_amount_avg, $dao->currency); $count += $dao->civicrm_contribution_total_amount_count; if ($softCredit) { - $softTotalAmount[] = - CRM_Utils_Money::format($dao->civicrm_contribution_soft_soft_amount_sum, $dao->currency) . + $softTotalAmount[] + = CRM_Utils_Money::format($dao->civicrm_contribution_soft_soft_amount_sum, $dao->currency) . " (" . $dao->civicrm_contribution_soft_soft_amount_count . ")"; $softAverage[] = CRM_Utils_Money::format($dao->civicrm_contribution_soft_soft_amount_avg, $dao->currency); $softCount += $dao->civicrm_contribution_soft_soft_amount_count; diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php index 78d937834c..6b3d80fa19 100644 --- a/CRM/Report/Form/Contribute/Sybunt.php +++ b/CRM/Report/Form/Contribute/Sybunt.php @@ -315,8 +315,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { public function groupBy() { $this->assign('chartSupported', TRUE); - $this->_groupBy = - "Group BY {$this->_aliases['civicrm_contribution']}.contact_id, " . + $this->_groupBy = "Group BY {$this->_aliases['civicrm_contribution']}.contact_id, " . self::fiscalYearOffset($this->_aliases['civicrm_contribution'] . '.receive_date') . " WITH ROLLUP "; } @@ -376,7 +375,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { $sql = "{$this->_select} {$this->_from} {$this->_where} {$this->_groupBy}"; } else { - $sql = + $sql = "" . "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" . implode(',', $contactIds) . ") AND {$this->_aliases['civicrm_contribution']}.is_test = 0 {$this->_statusClause} {$this->_groupBy} "; @@ -412,8 +411,8 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { $rows[$dao->civicrm_contribution_contact_id]['civicrm_life_time_total'] = $dao->civicrm_contribution_total_amount; if (($dao->civicrm_contribution_total_amount - $contributionSum) > 0 ) { - $rows[$dao->civicrm_contribution_contact_id]["civicrm_upto_{$upTo_year}"] = - $dao->civicrm_contribution_total_amount - $contributionSum; + $rows[$dao->civicrm_contribution_contact_id]["civicrm_upto_{$upTo_year}"] + = $dao->civicrm_contribution_total_amount - $contributionSum; } $contributionSum = 0; } @@ -448,18 +447,18 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { $interval["upto_{$upto}"] = "Up To {$upto}"; foreach ($rows as $key => $row) { - $display["upto_{$upto}"] = - CRM_Utils_Array::value("upto_{$upto}", $display) + - CRM_Utils_Array::value("civicrm_upto_{$upto}", $row); - $display[$previous_year] = - CRM_Utils_Array::value($previous_year, $display) + - CRM_Utils_Array::value($previous_year, $row); - $display[$previous_two_year] = - CRM_Utils_Array::value($previous_two_year, $display) + - CRM_Utils_Array::value($previous_two_year, $row); - $display[$previous_three_year] = - CRM_Utils_Array::value($previous_three_year, $display) + - CRM_Utils_Array::value($previous_three_year, $row); + $display["upto_{$upto}"] + = CRM_Utils_Array::value("upto_{$upto}", $display) + + CRM_Utils_Array::value("civicrm_upto_{$upto}", $row); + $display[$previous_year] + = CRM_Utils_Array::value($previous_year, $display) + + CRM_Utils_Array::value($previous_year, $row); + $display[$previous_two_year] + = CRM_Utils_Array::value($previous_two_year, $display) + + CRM_Utils_Array::value($previous_two_year, $row); + $display[$previous_three_year] + = CRM_Utils_Array::value($previous_three_year, $display) + + CRM_Utils_Array::value($previous_three_year, $row); } $graphRows['value'] = $display; diff --git a/CRM/Report/Form/Pledge/Pbnp.php b/CRM/Report/Form/Pledge/Pbnp.php index b5dee07c19..062ee27950 100644 --- a/CRM/Report/Form/Pledge/Pbnp.php +++ b/CRM/Report/Form/Pledge/Pbnp.php @@ -329,8 +329,7 @@ class CRM_Report_Form_Pledge_Pbnp extends CRM_Report_Form { //handle the Financial Type Ids if (array_key_exists('civicrm_pledge_financial_type_id', $row)) { if ($value = $row['civicrm_pledge_financial_type_id']) { - $rows[$rowNum]['civicrm_pledge_financial_type_id'] = - CRM_Contribute_PseudoConstant::financialType($value, FALSE); + $rows[$rowNum]['civicrm_pledge_financial_type_id'] = CRM_Contribute_PseudoConstant::financialType($value, FALSE); } $entryFound = TRUE; } diff --git a/CRM/SMS/Provider.php b/CRM/SMS/Provider.php index f374f904be..d6d1c5df11 100644 --- a/CRM/SMS/Provider.php +++ b/CRM/SMS/Provider.php @@ -120,7 +120,7 @@ abstract class CRM_SMS_Provider { * @param int $jobID * @param int $userID * - * @return $this|null|object + * @return self|null|object * @throws CRM_Core_Exception */ public function createActivity($apiMsgID, $message, $headers = array(), $jobID = NULL, $userID = NULL) { @@ -186,7 +186,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1"; * @param null $to * @param int $trackID * - * @return $this|null|object + * @return self|null|object * @throws CRM_Core_Exception */ public function processInbound($from, $body, $to = NULL, $trackID = NULL) { diff --git a/CRM/Utils/Cache/APCcache.php b/CRM/Utils/Cache/APCcache.php index ea0a28164e..50b4b2e3bb 100644 --- a/CRM/Utils/Cache/APCcache.php +++ b/CRM/Utils/Cache/APCcache.php @@ -110,7 +110,7 @@ class CRM_Utils_Cache_APCcache { foreach ($keys as $key) { $name = $key['info']; - if ($prefix == substr($name, 0, $lp)) { + if ($prefix == substr($name, 0, $lp)) { // Ours? apc_delete($this->_prefix . $name); } diff --git a/CRM/Utils/Wrapper.php b/CRM/Utils/Wrapper.php index 25aa5c2fdc..3f573db372 100644 --- a/CRM/Utils/Wrapper.php +++ b/CRM/Utils/Wrapper.php @@ -52,11 +52,12 @@ class CRM_Utils_Wrapper { * The heart of the callback processing is done by this method. * forms are of different type and have different operations. * - * @param string formName name of the form processing this action - * @param string formLabel label for the above form - * @param int mode mode of operation. - * @param bool addSequence should we add a unique sequence number to the end of the key - * @param bool ignoreKey should we not set a qfKey for this controller (for standalone forms) + * @param string $formName name of the form processing this action + * @param string $formLabel label for the above form + * @param array $arguments + * - int mode: mode of operation. + * - bool addSequence: should we add a unique sequence number to the end of the key + * - bool ignoreKey: should we not set a qfKey for this controller (for standalone forms) * * @return void */ diff --git a/api/v3/Address.php b/api/v3/Address.php index 6cc1bfdc1e..5b43c10799 100644 --- a/api/v3/Address.php +++ b/api/v3/Address.php @@ -140,8 +140,6 @@ function civicrm_api3_address_delete($params) { * Retrieve one or more addresses on address_id, contact_id, street_name, city * or a combination of those * - * @param mixed[] (reference ) input parameters - * * @param array $params * An associative array of name/value pairs. * diff --git a/api/v3/Case.php b/api/v3/Case.php index bb551985a7..63ac673ef7 100644 --- a/api/v3/Case.php +++ b/api/v3/Case.php @@ -39,7 +39,7 @@ /** * Open a new case, add client and manager roles, and add standard timeline * - * @param array ( + * @param array $params * //REQUIRED: * 'case_type_id' => int OR * 'case_type' => str (provide one or the other) @@ -182,14 +182,13 @@ function _civicrm_api3_case_delete_spec(&$params) { * * Please provide one (and only one) of the four get/search parameters: * - * @param array ( - * 'id' => if set, will get all available info about a case, including contacts and activities - * - * // if no case_id provided, this function will use one of the following search parameters: - * 'client_id' => finds all cases with a specific client - * 'activity_id' => returns the case containing a specific activity - * 'contact_id' => finds all cases associated with a contact (in any role, not just client) + * @param array $params + * 'id' => if set, will get all available info about a case, including contacts and activities * + * // if no case_id provided, this function will use one of the following search parameters: + * 'client_id' => finds all cases with a specific client + * 'activity_id' => returns the case containing a specific activity + * 'contact_id' => finds all cases associated with a contact (in any role, not just client) * * @throws API_Exception * @return array @@ -292,14 +291,14 @@ function _civicrm_api3_case_deprecation() { /** * Update a specified case. * - * @param array ( - * //REQUIRED: - * 'case_id' => int + * @param array $params + * //REQUIRED: + * 'case_id' => int * - * //OPTIONAL - * 'status_id' => int - * 'start_date' => str datestamp - * 'contact_id' => int // case client + * //OPTIONAL + * 'status_id' => int + * 'start_date' => str datestamp + * 'contact_id' => int // case client * * @throws API_Exception * @return array @@ -360,12 +359,12 @@ function civicrm_api3_case_update($params) { /** * Delete a specified case. * - * @param array ( - * //REQUIRED: - * 'id' => int + * @param array $params + * //REQUIRED: + * 'id' => int * - * //OPTIONAL - * 'move_to_trash' => bool (defaults to false) + * //OPTIONAL + * 'move_to_trash' => bool (defaults to false) * * @throws API_Exception * @return bool diff --git a/api/v3/Email.php b/api/v3/Email.php index f4d16f4de4..d288afef47 100644 --- a/api/v3/Email.php +++ b/api/v3/Email.php @@ -82,11 +82,6 @@ function civicrm_api3_email_delete($params) { /** * Retrieve one or more emails * - * @param array input parameters - * - * - * @example EmailGet.php Standard Get Example - * * @param array $params * An associative array of name/value pairs. * diff --git a/api/v3/Extension.php b/api/v3/Extension.php index 4bf680fc60..3646d416e0 100644 --- a/api/v3/Extension.php +++ b/api/v3/Extension.php @@ -180,12 +180,12 @@ function civicrm_api3_extension_uninstall($params) { * @example ExtensionDownload.php */ function civicrm_api3_extension_download($params) { - if (! array_key_exists('key', $params)) { + if (!array_key_exists('key', $params)) { throw new API_Exception('Missing required parameter: key'); } - if (! array_key_exists('url', $params)) { - if (! CRM_Extension_System::singleton()->getBrowser()->isEnabled()) { + if (!array_key_exists('url', $params)) { + if (!CRM_Extension_System::singleton()->getBrowser()->isEnabled()) { throw new API_Exception('Automatic downloading is diabled. Try adding parameter "url"'); } if ($reqs = CRM_Extension_System::singleton()->getBrowser()->checkRequirements()) { @@ -199,7 +199,7 @@ function civicrm_api3_extension_download($params) { } } - if (! array_key_exists('url', $params)) { + if (!array_key_exists('url', $params)) { throw new API_Exception('Cannot resolve download url for extension. Try adding parameter "url"'); } @@ -207,7 +207,7 @@ function civicrm_api3_extension_download($params) { return civicrm_api3_create_error($requirement['message']); } - if (! CRM_Extension_System::singleton()->getDownloader()->download($params['key'], $params['url'])) { + if (!CRM_Extension_System::singleton()->getDownloader()->download($params['key'], $params['url'])) { return civicrm_api3_create_error('Download failed - ZIP file is unavailable or malformed'); } CRM_Extension_System::singleton()->getCache()->flush(); diff --git a/api/v3/Generic/Setvalue.php b/api/v3/Generic/Setvalue.php index e05a6cdca4..55ba8b5bdf 100644 --- a/api/v3/Generic/Setvalue.php +++ b/api/v3/Generic/Setvalue.php @@ -22,8 +22,9 @@ function civicrm_api3_generic_setValue($apiRequest) { $fields = civicrm_api($entity, 'getFields', array('version' => 3, 'action' => 'create', "sequential")); // getfields error, shouldn't happen. - if ($fields['is_error']) - return $fields; + if ($fields['is_error']) { + return $fields; + } $fields = $fields['values']; $isCustom = strpos($field, 'custom_') === 0; @@ -68,8 +69,9 @@ function civicrm_api3_generic_setValue($apiRequest) { case CRM_Utils_Type::T_DATE: $value = CRM_Utils_Type::escape($value, "Date", FALSE); - if (!$value) + if (!$value) { return civicrm_api3_create_error("Param '$field' is not a date. format YYYYMMDD or YYYYMMDDHHMMSS"); + } break; case CRM_Utils_Type::T_BOOLEAN: