From c866eb5fc043b65a4baab6d400d4113220901e9b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 8 Jan 2015 18:54:52 -0800 Subject: [PATCH] INFRA-132 - Fix misc oddball syntax --- CRM/Activity/BAO/ActivityContact.php | 1 - CRM/Admin/Form/Preferences/Display.php | 5 +-- CRM/Bridge/OG/Drupal.php | 4 +- CRM/Core/Payment.php | 1 - CRM/Core/Payment/AuthorizeNet.php | 3 +- CRM/Core/Payment/Dummy.php | 5 +-- CRM/Core/Payment/FirstData.php | 38 ++++++++++--------- .../Smarty/plugins/function.isValueChange.php | 1 - .../Smarty/plugins/function.sectionTotal.php | 1 - CRM/Event/Form/Registration/Register.php | 3 +- CRM/Financial/BAO/ExportFormat/CSV.php | 5 +-- CRM/Financial/BAO/ExportFormat/IIF.php | 4 +- CRM/Member/BAO/Membership.php | 6 +-- CRM/Utils/String.php | 6 +-- api/v3/Generic.php | 3 +- api/v3/Generic/Setvalue.php | 12 +++--- api/v3/Group.php | 8 ++-- api/v3/utils.php | 6 +-- tests/karma/unit/crmCaseTypeSpec.js | 6 +-- tests/karma/unit/crmJsonComparator.js | 4 +- tests/karma/unit/crmMailingSpec.js | 2 +- 21 files changed, 59 insertions(+), 65 deletions(-) diff --git a/CRM/Activity/BAO/ActivityContact.php b/CRM/Activity/BAO/ActivityContact.php index f6bfceaad1..78f2453201 100644 --- a/CRM/Activity/BAO/ActivityContact.php +++ b/CRM/Activity/BAO/ActivityContact.php @@ -143,7 +143,6 @@ AND civicrm_contact.is_deleted = 0 /** * Get the links associate array as defined by the links.ini file. * - * * Experimental... - * Should look a bit like * [local_col_name] => "related_tablename:related_col_name" diff --git a/CRM/Admin/Form/Preferences/Display.php b/CRM/Admin/Form/Preferences/Display.php index 9fcb4ed638..2e828005d2 100644 --- a/CRM/Admin/Form/Preferences/Display.php +++ b/CRM/Admin/Form/Preferences/Display.php @@ -33,9 +33,8 @@ * */ -/**r - * This class generates form components for the display preferences - * +/** + * This class generates form components for the display preferences. */ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences { public function preProcess() { diff --git a/CRM/Bridge/OG/Drupal.php b/CRM/Bridge/OG/Drupal.php index 0f6b3b7e9b..f6f4cd3cf1 100644 --- a/CRM/Bridge/OG/Drupal.php +++ b/CRM/Bridge/OG/Drupal.php @@ -33,7 +33,9 @@ * */ -// d6 compatible +/** + * d6 compatible? + */ class CRM_Bridge_OG_Drupal { /** diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index c52693c8e8..8192ae62be 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -96,7 +96,6 @@ abstract class CRM_Core_Payment { * Should we force a reload of this payment object. * * @return CRM_Core_Payment - * @return \CRM_Core_Payment * @throws \CRM_Core_Exception * @static */ diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index 5fe0710c56..da76005dd2 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -13,7 +13,8 @@ * @author Marshal Newrock */ -/* NOTE: +/** + * NOTE: * When looking up response codes in the Authorize.Net API, they * begin at one, so always delete one from the "Position in Response" */ diff --git a/CRM/Core/Payment/Dummy.php b/CRM/Core/Payment/Dummy.php index 93f07389c0..447a414eba 100644 --- a/CRM/Core/Payment/Dummy.php +++ b/CRM/Core/Payment/Dummy.php @@ -14,9 +14,8 @@ * $Id: Dummy.php 45429 2013-02-06 22:11:18Z lobo $ */ -/* NOTE: - * When looking up response codes in the Authorize.Net API, they - * begin at one, so always delete one from the "Position in Response" +/** + * Dummy payment processor */ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { const CHARSET = 'iso-8859-1'; diff --git a/CRM/Core/Payment/FirstData.php b/CRM/Core/Payment/FirstData.php index ff83bbe9f4..a0d106d585 100644 --- a/CRM/Core/Payment/FirstData.php +++ b/CRM/Core/Payment/FirstData.php @@ -31,24 +31,26 @@ ----------------------------------------------------------------------------------------------- **/ -/*From Payment processor documentation -For testing purposes, you can use any of the card numbers listed below. The test card numbers -will not result in any charges to the card. Use these card numbers with any expiration date in the -future. - Visa Level 2 - 4275330012345675 (replies with a referral message) - JCB - 3566007770003510 - Discover - 6011000993010978 - MasterCard - 5424180279791765 - Visa - 4005550000000019 or 4111111111111111 - MasterCard Level 2 - 5404980000008386 - Diners - 36555565010005 - Amex - 372700997251009 -* -*************************** -*Lines starting with CRM_Core_Error::debug_log_message output messages to files/upload/civicrm.log - you may with to comment them out once it is working satisfactorily - -*For live testing uncomment the result field below and set the value to the response you wish to get from the payment processor -***************************/ +/** + * From Payment processor documentation + * For testing purposes, you can use any of the card numbers listed below. The test card numbers + * will not result in any charges to the card. Use these card numbers with any expiration date in the + * future. + * Visa Level 2 - 4275330012345675 (replies with a referral message) + * JCB - 3566007770003510 + * Discover - 6011000993010978 + * MasterCard - 5424180279791765 + * Visa - 4005550000000019 or 4111111111111111 + * MasterCard Level 2 - 5404980000008386 + * Diners - 36555565010005 + * Amex - 372700997251009 + * + * ************************** + * Lines starting with CRM_Core_Error::debug_log_message output messages to files/upload/civicrm.log - you may with to comment them out once it is working satisfactorily + * + * For live testing uncomment the result field below and set the value to the response you wish to get from the payment processor + * ************************** + */ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { # (not used, implicit in the API, might need to convert?) const CHARSET = 'UFT-8'; diff --git a/CRM/Core/Smarty/plugins/function.isValueChange.php b/CRM/Core/Smarty/plugins/function.isValueChange.php index 96c67cd353..2e484bc2ea 100644 --- a/CRM/Core/Smarty/plugins/function.isValueChange.php +++ b/CRM/Core/Smarty/plugins/function.isValueChange.php @@ -40,7 +40,6 @@ * Smarty function for checking change in a property's value, for example * when looping through an array. * - * * Smarty param: string $key unique identifier for this property (REQUIRED) * Smarty param: mixed $value the current value of the property * Smarty param: string $assign name of template variable to which to assign result diff --git a/CRM/Core/Smarty/plugins/function.sectionTotal.php b/CRM/Core/Smarty/plugins/function.sectionTotal.php index 89065a3427..66caa4a389 100644 --- a/CRM/Core/Smarty/plugins/function.sectionTotal.php +++ b/CRM/Core/Smarty/plugins/function.sectionTotal.php @@ -39,7 +39,6 @@ /** * Smarty block function for printintg the correct report section total * - * * Smarty param: string $key value of the current section column * Smarty param: int $depth the depth of the current section * (sections declared first have lesser depth, starting at 0) diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 7a49e25293..66681f4721 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -136,10 +136,9 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * The 'Register' page gets loaded through ajax and following happens : * the setDefaults function is called with the variable _ppType set with selected payment processor type, * so in the 'if' condition checked whether the selected payment processor's billing mode is of 'billing form mode'. If its not, don't setDefaults for billing form and return instead. - *- For payment processors of billing mode 'Notify' - return from setDefaults before the code for billing profile population execution . + * - For payment processors of billing mode 'Notify' - return from setDefaults before the code for billing profile population execution . * (done this is because for payment processors with 'Notify' mode billing profile form doesn't get rendered on UI) * - * * @return void */ public function setDefaultValues() { diff --git a/CRM/Financial/BAO/ExportFormat/CSV.php b/CRM/Financial/BAO/ExportFormat/CSV.php index 3959f3fcb1..d9327ecd75 100644 --- a/CRM/Financial/BAO/ExportFormat/CSV.php +++ b/CRM/Financial/BAO/ExportFormat/CSV.php @@ -34,10 +34,9 @@ * */ -/* - * @see http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Specifications+-++Batches#CiviAccountsSpecifications-Batches-%C2%A0Overviewofimplementation +/** + * @link http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Specifications+-++Batches#CiviAccountsSpecifications-Batches-%C2%A0Overviewofimplementation */ - class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat { // For this phase, we always output these records too so that there isn't data referenced in the journal entries that isn't defined anywhere. diff --git a/CRM/Financial/BAO/ExportFormat/IIF.php b/CRM/Financial/BAO/ExportFormat/IIF.php index 76891bcad5..179fda8ab2 100644 --- a/CRM/Financial/BAO/ExportFormat/IIF.php +++ b/CRM/Financial/BAO/ExportFormat/IIF.php @@ -34,8 +34,8 @@ * */ -/* - * @see http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Specifications+-++Batches#CiviAccountsSpecifications-Batches-%C2%A0Overviewofimplementation +/** + * @link http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Specifications+-++Batches#CiviAccountsSpecifications-Batches-%C2%A0Overviewofimplementation */ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat { diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 1b698a7105..0965af07bb 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1477,15 +1477,13 @@ AND civicrm_membership.is_test = %2"; /** * Function for updating a membership record's contribution_recur_id * - * @param object CRM_Member_DAO_Membership $membership + * @param CRM_Member_DAO_Membership $membership * @param \CRM_Contribute_BAO_Contribution|\CRM_Contribute_DAO_Contribution $contribution * * @return void * @static */ - static public function updateRecurMembership( - CRM_Member_DAO_Membership $membership, - CRM_Contribute_BAO_Contribution $contribution) { + static public function updateRecurMembership(CRM_Member_DAO_Membership $membership, CRM_Contribute_BAO_Contribution $contribution) { if (empty($contribution->contribution_recur_id)) { return; diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 0379bf0eac..b5aef70a95 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -55,10 +55,8 @@ class CRM_Utils_String { * * @param int $maxLength * - * @return string An equivalent variable name - * - * - * @return string (or null) + * @return string + * An equivalent variable name. * @static */ public static function titleToVar($title, $maxLength = 31) { diff --git a/api/v3/Generic.php b/api/v3/Generic.php index 22936c54e4..00ce07b107 100644 --- a/api/v3/Generic.php +++ b/api/v3/Generic.php @@ -104,7 +104,8 @@ function civicrm_api3_generic_getfields($apiRequest) { 'title' => 'Context', ), ); - break; + break; + default: // oddballs are on their own $metadata = array(); diff --git a/api/v3/Generic/Setvalue.php b/api/v3/Generic/Setvalue.php index 7e6c705a66..249abba758 100644 --- a/api/v3/Generic/Setvalue.php +++ b/api/v3/Generic/Setvalue.php @@ -48,23 +48,23 @@ function civicrm_api3_generic_setValue($apiRequest) { if (!is_numeric($value) && !empty($value) && $value !== 'null') { return civicrm_api3_create_error(ts('%1 must be a number.', array(1 => $title)), array('error_code' => 'NaN')); } - break; + break; case CRM_Utils_Type::T_INT: if (!CRM_Utils_Rule::integer($value) && !empty($value) && $value !== 'null') { return civicrm_api3_create_error(ts('%1 must be a number.', array(1 => $title)), array('error_code' => 'NaN')); } - break; + break; case CRM_Utils_Type::T_STRING: case CRM_Utils_Type::T_TEXT: if (!CRM_Utils_Rule::xssString($value)) { return civicrm_api3_create_error(ts('Illegal characters in input (potential scripting attack)'), array('error_code' => 'XSS')); } - if (array_key_exists('maxlength', $def)) { - $value = substr($value, 0, $def['maxlength']); - } - break; + if (array_key_exists('maxlength', $def)) { + $value = substr($value, 0, $def['maxlength']); + } + break; case CRM_Utils_Type::T_DATE: $value = CRM_Utils_Type::escape($value,"Date",false); diff --git a/api/v3/Group.php b/api/v3/Group.php index 22f7e38eb0..510d1ab1f8 100644 --- a/api/v3/Group.php +++ b/api/v3/Group.php @@ -48,8 +48,8 @@ * name/value pairs to insert in new 'group' * * @return array API result array - *@example GroupCreate.php - *{@getfields group_create} + * @example GroupCreate.php + * {@getfields group_create} * @access public */ function civicrm_api3_group_create($params) { @@ -105,8 +105,8 @@ function civicrm_api3_group_get($params) { * to be deleted * * @return array API result array - *@example GroupDelete.php - *{@getfields group_delete} + * @example GroupDelete.php + * {@getfields group_delete} * * @access public */ diff --git a/api/v3/utils.php b/api/v3/utils.php index 811194ddfe..70858805b2 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -1125,9 +1125,9 @@ function formatCheckBoxField(&$checkboxFieldValue, $customFieldLabel, $entity) { * * @daoName string DAO to check params agains * - * @return bool should the missing fields be returned as an array (core error created as default) - * - * @return bool true if all fields present, depending on $result a core error is created of an array of missing fields is returned + * @return bool + * Sshould the missing fields be returned as an array (core error created as default) + * true if all fields present, depending on $result a core error is created of an array of missing fields is returned * @access public */ function _civicrm_api3_check_required_fields($params, $daoName, $return = FALSE) { diff --git a/tests/karma/unit/crmCaseTypeSpec.js b/tests/karma/unit/crmCaseTypeSpec.js index 260a6e0dbb..c4917626ab 100644 --- a/tests/karma/unit/crmCaseTypeSpec.js +++ b/tests/karma/unit/crmCaseTypeSpec.js @@ -65,7 +65,7 @@ describe('crmCaseType', function() { "id": "784", "option_group_id": "2", "label": "ADC referral", - "value": "62", + "value": "62", "name": "ADC referral", "filter": "0", "is_default": "0", @@ -89,7 +89,7 @@ describe('crmCaseType', function() { "is_reserved": "1", "is_active": "1", "component_id": "7" - } + } } }, 'relTypes': { @@ -136,7 +136,7 @@ describe('crmCaseType', function() { ], "activitySets": [ { - "name": "standard_timeline", + "name": "standard_timeline", "label": "Standard Timeline", "timeline": "1", "activityTypes": [ diff --git a/tests/karma/unit/crmJsonComparator.js b/tests/karma/unit/crmJsonComparator.js index 8380ba7951..d4b668cf4f 100644 --- a/tests/karma/unit/crmJsonComparator.js +++ b/tests/karma/unit/crmJsonComparator.js @@ -10,7 +10,7 @@ describe('crmJsonComparator', function() { beforeEach(function() { inject(function(crmJsonComparator) { comparator = crmJsonComparator; - }); + }); }); it('should return false when comparing different objects', function() { @@ -23,7 +23,7 @@ describe('crmJsonComparator', function() { expect(result.pass).toBe(true); }); - it('should explain what part of the comparison failed when comparing objects', function() { + it('should explain what part of the comparison failed when comparing objects', function() { var result = comparator.compare({'foo': 'bar'}, {'bar': 'foo'}); expect(result.message).toBe('Could not find key \'bar\' in actual data at root.'); }); diff --git a/tests/karma/unit/crmMailingSpec.js b/tests/karma/unit/crmMailingSpec.js index 8d35904988..db795bfaeb 100644 --- a/tests/karma/unit/crmMailingSpec.js +++ b/tests/karma/unit/crmMailingSpec.js @@ -14,7 +14,7 @@ describe('crmMailing', function() { beforeEach(function() { navigator = jasmine.createSpyObj('crmNavigator', ['redirect']); module(function ($provide) { - $provide.value('crmNavigator', navigator) + $provide.value('crmNavigator', navigator) }); inject(['crmLegacy', function(crmLegacy) { crmLegacy.url({back: '/*path*?*query*', front: '/*path*?*query*'}); -- 2.25.1