From 79d7553f54ee92645478d09cf794a539ebb15856 Mon Sep 17 00:00:00 2001 From: kurund Date: Sun, 18 Jan 2015 22:20:20 +0530 Subject: [PATCH] more cleanup batch 16 --- CRM/Activity/Import/Form/DataSource.php | 2 +- CRM/Activity/Page/AJAX.php | 12 ++++++------ CRM/Activity/Page/UserDashboard.php | 10 +++++----- CRM/Campaign/Form/Survey/Questions.php | 10 ++-------- CRM/Contact/Form/Search.php | 14 +++++++------- CRM/Contact/Form/Search/Custom/DateAdded.php | 2 +- CRM/Contact/Form/Search/Custom/Proximity.php | 2 +- CRM/Contact/Form/Task/RemoveFromGroup.php | 12 ++++++------ CRM/Contact/Page/SavedSearch.php | 1 - CRM/Contact/Selector.php | 8 ++++---- CRM/Contribute/BAO/ContributionPage.php | 8 ++++---- CRM/Core/BAO/FinancialTrxn.php | 13 ++++++------- CRM/Core/BAO/UFMatch.php | 4 ++-- CRM/Core/SelectValues.php | 10 +++++----- .../Smarty/plugins/modifier.mb_truncate.php | 8 ++++---- CRM/Dedupe/BAO/QueryBuilder.php | 3 --- .../Form/Registration/ParticipantConfirm.php | 8 ++++---- CRM/Event/Form/Task/SaveSearch.php | 2 +- CRM/Event/Import/Parser/Participant.php | 8 ++++---- CRM/Financial/BAO/PaymentProcessor.php | 9 ++++----- CRM/Financial/Page/Batch.php | 2 -- CRM/Grant/Page/Tab.php | 3 +-- CRM/Import/Form/MapField.php | 8 ++++---- CRM/Mailing/Form/Component.php | 8 ++++---- CRM/Mailing/Form/Group.php | 10 +++++----- CRM/Mailing/Form/Upload.php | 8 ++++---- CRM/Mailing/MailStore/Maildir.php | 8 ++++---- CRM/Member/Form/Membership.php | 8 ++++---- CRM/Price/BAO/LineItem.php | 5 ++--- CRM/Price/Form/DeleteField.php | 9 +-------- CRM/Price/Form/DeleteSet.php | 2 +- CRM/Price/Page/Field.php | 8 +------- CRM/Report/BAO/Hook.php | 6 ++++-- CRM/Upgrade/Controller.php | 2 +- CRM/Utils/Hook/UnitTests.php | 2 +- CRM/Utils/Weight.php | 2 +- api/v3/Country.php | 9 +++------ api/v3/LocationType.php | 9 +++------ api/v3/utils.php | 2 +- bin/csv/import.php | 2 +- bin/deprecated/CiviReportMail.php | 8 ++++---- bin/deprecated/UpdateGreeting.php | 8 ++++---- .../CRM/Mailing/BAO/QueryTestDataProvider.php | 8 ++++---- tests/phpunit/CRM/Queue/AllTests.php | 2 +- tests/phpunit/CRM/Queue/Queue/SqlTest.php | 7 +++++-- .../Subscriber/TransactionSubscriberTest.php | 8 ++++---- tests/phpunit/CiviTest/CiviUnitTestCase.php | 8 ++++---- .../WebTest/Contact/AdvancedSearchTest.php | 8 ++++---- .../Member/BatchUpdateViaProfileTest.php | 2 +- .../WebTest/Member/FixedMembershipTypeTest.php | 8 ++++---- tests/phpunit/api/v3/CaseTest.php | 8 ++++---- tests/phpunit/api/v3/ContributionSoftTest.php | 18 ++++++++++++------ .../phpunit/api/v3/TaxContributionPageTest.php | 2 +- 53 files changed, 165 insertions(+), 189 deletions(-) diff --git a/CRM/Activity/Import/Form/DataSource.php b/CRM/Activity/Import/Form/DataSource.php index bd20b21593..a957a1cd0d 100644 --- a/CRM/Activity/Import/Form/DataSource.php +++ b/CRM/Activity/Import/Form/DataSource.php @@ -67,7 +67,7 @@ class CRM_Activity_Import_Form_DataSource extends CRM_Core_Form { $this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE); $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array( 1 => $uploadSize, - 2 => $uploadFileSize + 2 => $uploadFileSize, )), 'maxfilesize', $uploadFileSize); $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile'); $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File'); diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 7bb5f47e3d..f5bc179753 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -77,7 +77,7 @@ class CRM_Activity_Page_AJAX { 'reporter', 'status', 'links', - 'class' + 'class', ); echo CRM_Utils_JSON::encodeDataTableSelector($activities, $sEcho, $iTotal, $iFilteredTotal, $selectorElements); @@ -293,8 +293,8 @@ class CRM_Activity_Page_AJAX { $contactType = $contactType == 'Contact' ? '' : $contactType; switch ($row['source']) { case 'caseRel': - $row['actions'] = - '' . + $row['actions'] + = '' . '' . '' . '' . @@ -303,8 +303,8 @@ class CRM_Activity_Page_AJAX { break; case 'caseRoles': - $row['actions'] = - '' . + $row['actions'] + = '' . '' . ''; break; @@ -375,7 +375,7 @@ class CRM_Activity_Page_AJAX { if (in_array($params['mode'], array( 'move', - 'file' + 'file', ))) { $caseActivity = new CRM_Case_DAO_CaseActivity(); $caseActivity->case_id = $params['caseID']; diff --git a/CRM/Activity/Page/UserDashboard.php b/CRM/Activity/Page/UserDashboard.php index 04f1eb9b3c..dc7d7c18f7 100644 --- a/CRM/Activity/Page/UserDashboard.php +++ b/CRM/Activity/Page/UserDashboard.php @@ -41,12 +41,12 @@ class CRM_Activity_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoar /** * List participations for the UF user * - * @return null + * @return bool */ public function listActivities() { - $controller = - new CRM_Core_Controller_Simple( + $controller + = new CRM_Core_Controller_Simple( 'CRM_Activity_Form_Search', ts('Activities'), NULL, FALSE, FALSE, TRUE, FALSE @@ -61,14 +61,14 @@ class CRM_Activity_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoar $controller->process(); $controller->run(); - return; + return FALSE; } /** * the main function that is called when the page * loads, it decides the which action has to be taken for the page. * - * @return null + * @return void */ public function run() { parent::preProcess(); diff --git a/CRM/Campaign/Form/Survey/Questions.php b/CRM/Campaign/Form/Survey/Questions.php index 078f3bc4af..ac1e44b50e 100644 --- a/CRM/Campaign/Form/Survey/Questions.php +++ b/CRM/Campaign/Form/Survey/Questions.php @@ -43,8 +43,6 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey { * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * - * @param null - * * @return array * array of default values */ @@ -57,8 +55,8 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey { 'entity_id' => $this->_surveyId, ); - list($defaults['contact_profile_id'], $second) = - CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams); + list($defaults['contact_profile_id'], $second) + = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams); $defaults['activity_profile_id'] = $second ? array_shift($second) : ''; return $defaults; @@ -67,8 +65,6 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -107,8 +103,6 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey { /** * Process the form * - * @param null - * * @return void */ public function postProcess() { diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index a0f849701e..3bb065da0b 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -342,8 +342,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { $tasks = $tasks + CRM_Contact_Task::optionalTaskTitle(); } - $search_custom_id = - CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'search_custom_id'); + $search_custom_id + = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'search_custom_id'); $savedSearchValues = array( 'id' => $this->_ssID, @@ -375,8 +375,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { // check if _groupID exists, it might not if // we are displaying a hidden group if (!isset($this->_group[$this->_groupID])) { - $this->_group[$this->_groupID] = - CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'title'); + $this->_group[$this->_groupID] + = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'title'); } // set the group title @@ -417,8 +417,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { // we are displaying a hidden group if (!isset($this->_group[$this->_amtgID])) { $this->assign('permissionedForGroup', FALSE); - $this->_group[$this->_amtgID] = - CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_amtgID, 'title'); + $this->_group[$this->_amtgID] + = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_amtgID, 'title'); } // Set dynamic page title for 'Add Members Group' @@ -797,7 +797,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { $setDynamic = FALSE; if (strpos(self::$_selectorName, 'CRM_Contact_Selector') !== FALSE) { - $selector = new self::$_selectorName ( + $selector = new self::$_selectorName( $this->_customSearchClass, $this->_formValues, $this->_params, diff --git a/CRM/Contact/Form/Search/Custom/DateAdded.php b/CRM/Contact/Form/Search/Custom/DateAdded.php index 0075f3f05f..14ed83351f 100644 --- a/CRM/Contact/Form/Search/Custom/DateAdded.php +++ b/CRM/Contact/Form/Search/Custom/DateAdded.php @@ -121,7 +121,7 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C * * @return string */ - function all( + public function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { diff --git a/CRM/Contact/Form/Search/Custom/Proximity.php b/CRM/Contact/Form/Search/Custom/Proximity.php index de7bb987d4..1e2cb42048 100644 --- a/CRM/Contact/Form/Search/Custom/Proximity.php +++ b/CRM/Contact/Form/Search/Custom/Proximity.php @@ -170,7 +170,7 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C * * @return string */ - function all( + public function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { diff --git a/CRM/Contact/Form/Task/RemoveFromGroup.php b/CRM/Contact/Form/Task/RemoveFromGroup.php index f96c4141a0..22b4cd294c 100644 --- a/CRM/Contact/Form/Task/RemoveFromGroup.php +++ b/CRM/Contact/Form/Task/RemoveFromGroup.php @@ -85,21 +85,21 @@ class CRM_Contact_Form_Task_RemoveFromGroup extends CRM_Contact_Form_Task { $status = array( ts("%count contact removed from '%2'", array( - 'count' => $removed, - 'plural' => "%count contacts removed from '%2'", - 2 => $group[$groupId] - )) + 'count' => $removed, + 'plural' => "%count contacts removed from '%2'", + 2 => $group[$groupId], + )), ); if ($notRemoved) { $status[] = ts('1 contact was already not in this group', array( 'count' => $notRemoved, - 'plural' => '%count contacts were already not in this group' + 'plural' => '%count contacts were already not in this group', )); } $status = ''; CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", array( 'plural' => "Removed Contacts From Group", - 'count' => $removed + 'count' => $removed, )), 'success', array('expires' => 0)); } } diff --git a/CRM/Contact/Page/SavedSearch.php b/CRM/Contact/Page/SavedSearch.php index 59d29df832..b7a104280c 100644 --- a/CRM/Contact/Page/SavedSearch.php +++ b/CRM/Contact/Page/SavedSearch.php @@ -66,7 +66,6 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page { $savedSearch->id = $id; $savedSearch->is_active = 0; $savedSearch->save(); - return; } /** diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index ec73b2aa94..df3d489484 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -153,7 +153,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * * @return CRM_Contact_Selector */ - function __construct( + public function __construct( $customSearchClass, $formValues = NULL, $params = NULL, @@ -412,7 +412,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se if (in_array($fieldName, array( 'phone', 'im', - 'email' + 'email', ))) { if ($type) { $name = "`$locationTypeName-$fieldName-$type`"; @@ -593,7 +593,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se if (in_array($fieldName, array( 'phone', 'im', - 'email' + 'email', ))) { if ($type) { $names[] = "{$locationTypeName}-{$fieldName}-{$type}"; @@ -678,7 +678,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se elseif (in_array($property, array( 'addressee', 'email_greeting', - 'postal_greeting' + 'postal_greeting', ))) { $greeting = $property . '_display'; $row[$property] = $result->$greeting; diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 979a181bbb..234c8c3200 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -712,7 +712,7 @@ WHERE entity_table = 'civicrm_contribution_page' * @param int $contributionPageId * Contribution Page Id. * - * @return boolean + * @return bool * true if payment processor supports recurring * else false * @@ -823,7 +823,7 @@ LEFT JOIN civicrm_premiums ON ( civicrm_premiums.entity_id = civicrm // Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get return CRM_Financial_BAO_FinancialType::getIncomeFinancialType(); - break; + break; } return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context); } @@ -924,7 +924,7 @@ LEFT JOIN civicrm_premiums ON ( civicrm_premiums.entity_id = civicrm /** * Helper to determine if the page supports separate membership payments - * @param int id form id + * @param int $id form id * * @return bool * isSeparateMembershipPayment @@ -933,7 +933,7 @@ LEFT JOIN civicrm_premiums ON ( civicrm_premiums.entity_id = civicrm $membershipBlocks = civicrm_api3('membership_block', 'get', array( 'entity_table' => 'civicrm_contribution_page', 'entity_id' => $id, - 'sequential' => TRUE + 'sequential' => TRUE, )); if (!$membershipBlocks['count']) { return FALSE; diff --git a/CRM/Core/BAO/FinancialTrxn.php b/CRM/Core/BAO/FinancialTrxn.php index 836a1b252f..314a8dac40 100644 --- a/CRM/Core/BAO/FinancialTrxn.php +++ b/CRM/Core/BAO/FinancialTrxn.php @@ -67,8 +67,8 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { $trxn->save(); // save to entity_financial_trxn table - $entityFinancialTrxnParams = - array( + $entityFinancialTrxnParams + = array( 'entity_table' => "civicrm_contribution", 'financial_trxn_id' => $trxn->id, 'amount' => $params['total_amount'], @@ -384,8 +384,7 @@ WHERE ceft.entity_id = %1"; $params['trxnParams']['from_financial_account_id'] = $params['to_financial_account_id']; $params['trxnParams']['to_financial_account_id'] = $financialAccount; $params['trxnParams']['total_amount'] = $amount; - $params['trxnParams']['fee_amount'] = - $params['trxnParams']['net_amount'] = 0; + $params['trxnParams']['fee_amount'] = $params['trxnParams']['net_amount'] = 0; $params['trxnParams']['status_id'] = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name'); $params['trxnParams']['contribution_id'] = $contributionId; $trxn = self::create($params['trxnParams']); @@ -393,8 +392,8 @@ WHERE ceft.entity_id = %1"; $financialTrxnID = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($params['trxnParams']['contribution_id'], 'DESC'); $params['entity_id'] = $financialTrxnID['financialTrxnId']; } - $fItemParams = - array( + $fItemParams + = array( 'financial_account_id' => $financialAccount, 'contact_id' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', $domainId, 'contact_id'), 'created_date' => date('YmdHis'), @@ -416,7 +415,7 @@ WHERE ceft.entity_id = %1"; * @param int $entityId * @param string $entityName * @param bool $returnType - * @param number $lineItemTotal + * @param int $lineItemTotal * * @return array|int|NULL|string * [payment type => amount] diff --git a/CRM/Core/BAO/UFMatch.php b/CRM/Core/BAO/UFMatch.php index a078186443..6df82a9707 100644 --- a/CRM/Core/BAO/UFMatch.php +++ b/CRM/Core/BAO/UFMatch.php @@ -142,8 +142,8 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch { // add current contact to recently viewed if ($ufmatch->contact_id) { - list($displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl) = - CRM_Contact_BAO_Contact::getDisplayAndImage($ufmatch->contact_id, TRUE, TRUE); + list($displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl) + = CRM_Contact_BAO_Contact::getDisplayAndImage($ufmatch->contact_id, TRUE, TRUE); $otherRecent = array( 'imageUrl' => $contactImageUrl, diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index 089bbb9150..e3385b8008 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -39,7 +39,7 @@ class CRM_Core_SelectValues { /** * Preferred mail format - * + * * @return array */ public static function pmf() { @@ -81,7 +81,7 @@ class CRM_Core_SelectValues { /** * Various pre defined unit list - * + * * @param string $unitType * @return array */ @@ -762,7 +762,7 @@ class CRM_Core_SelectValues { /** * Get numeric options - * + * * @param int $start * @param int $end * @@ -975,8 +975,8 @@ class CRM_Core_SelectValues { static $scheduleReminderFrequencyUnits = NULL; if (!$scheduleReminderFrequencyUnits) { $scheduleReminderFrequencyUnits = array( - 'hour' => ts('hour') - ) + CRM_Core_OptionGroup::values('recur_frequency_units'); + 'hour' => ts('hour'), + ) + CRM_Core_OptionGroup::values('recur_frequency_units'); } return $scheduleReminderFrequencyUnits; diff --git a/CRM/Core/Smarty/plugins/modifier.mb_truncate.php b/CRM/Core/Smarty/plugins/modifier.mb_truncate.php index 997da1c479..7e3f2b3af4 100644 --- a/CRM/Core/Smarty/plugins/modifier.mb_truncate.php +++ b/CRM/Core/Smarty/plugins/modifier.mb_truncate.php @@ -50,10 +50,10 @@ * @link http://smarty.php.net/manual/en/language.modifier.truncate.php * truncate (Smarty online manual) * - * @param string - * @param int - * @param string - * @param bool + * @param string $string + * @param int $length + * @param string $etc + * @param bool $break_words * * @return string */ diff --git a/CRM/Dedupe/BAO/QueryBuilder.php b/CRM/Dedupe/BAO/QueryBuilder.php index 393a4dab49..d9ba5483b9 100644 --- a/CRM/Dedupe/BAO/QueryBuilder.php +++ b/CRM/Dedupe/BAO/QueryBuilder.php @@ -1,5 +1,4 @@ _cc == 'fail') { $statusMsg = '
' . ts('Your Credit Card transaction was not successful. No money has yet been charged to your card.') . '

' . ts('Click the "Confirm Registration" button to complete your registration in %1, or click "Cancel Registration" if you are no longer interested in attending this event.', array( - 1 => $values['title'] + 1 => $values['title'], )) . '
'; } else { $statusMsg = '
' . ts('Confirm your registration for %1.', array( - 1 => $values['title'] + 1 => $values['title'], )) . '

' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '
'; } $buttons = array_merge($buttons, array( @@ -134,7 +134,7 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi 'name' => ts('Confirm Registration'), 'spacing' => '         ', 'isDefault' => TRUE, - ) + ), )); } } @@ -150,7 +150,7 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi 'name' => ts('Cancel Registration'), 'spacing' => '         ', 'js' => array('onclick' => 'return confirm(\'' . $cancelConfirm . '\');'), - ) + ), )); if (!$statusMsg) { $statusMsg = ts('You can cancel your registration for %1 by clicking "Cancel Registration".', array(1 => $values['title'])); diff --git a/CRM/Event/Form/Task/SaveSearch.php b/CRM/Event/Form/Task/SaveSearch.php index 0d260c82c5..df7be728e9 100644 --- a/CRM/Event/Form/Task/SaveSearch.php +++ b/CRM/Event/Form/Task/SaveSearch.php @@ -52,7 +52,7 @@ class CRM_Event_Form_Task_SaveSearch extends CRM_Event_Form_Task { * * @return void */ - function preProcess() { + public function preProcess() { parent::preProcess(); $this->_id = NULL; } diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index 84a05665d0..10ce73d698 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -128,7 +128,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool */ public function mapField(&$values) { return CRM_Import_Parser::VALID; @@ -140,7 +140,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool * the result of this processing */ public function preview(&$values) { @@ -153,7 +153,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool * the result of this processing */ public function summary(&$values) { @@ -272,7 +272,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool * the result of this processing */ public function import($onDuplicate, &$values) { diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index eedcf0f643..b6151b29b2 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -133,8 +133,6 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces /** * Retrieve the default payment processor * - * @param NULL - * * @return CRM_Financial_DAO_PaymentProcessor|null * The default payment processor object on success, * null otherwise @@ -239,7 +237,8 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * (sort function for sortDefaultFirst) * @param array $processor1 * @param array $processor2 - * @return number + * + * @return int */ public static function defaultComparison($processor1, $processor2) { $p1 = CRM_Utils_Array::value('is_default', $processor1); @@ -315,7 +314,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces $retrievalParameters = array( 'is_active' => TRUE, 'options' => array('sort' => 'is_default DESC, name'), - 'api.payment_processor_type.getsingle' => 1 + 'api.payment_processor_type.getsingle' => 1, ); if ($mode == 'test') { $retrievalParameters['is_test'] = 1; @@ -418,7 +417,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces if (!in_array($component, array( 'membership', 'contribute', - 'recur' + 'recur', )) ) { return $result; diff --git a/CRM/Financial/Page/Batch.php b/CRM/Financial/Page/Batch.php index e85c6bb618..90e7202ca3 100644 --- a/CRM/Financial/Page/Batch.php +++ b/CRM/Financial/Page/Batch.php @@ -58,8 +58,6 @@ class CRM_Financial_Page_Batch extends CRM_Core_Page_Basic { /** * Get action Links * - * @return array - * (reference) of action links */ public function &links() { } diff --git a/CRM/Grant/Page/Tab.php b/CRM/Grant/Page/Tab.php index 37e055ca3f..0c8b3e6488 100644 --- a/CRM/Grant/Page/Tab.php +++ b/CRM/Grant/Page/Tab.php @@ -51,9 +51,8 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View { /** * called when action is browse * - * @return null */ - function browse() { + public function browse() { $controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Search', ts('Grants'), $this->_action); $controller->setEmbedded(TRUE); $controller->reset(); diff --git a/CRM/Import/Form/MapField.php b/CRM/Import/Form/MapField.php index fab0373472..49ab9dbe03 100644 --- a/CRM/Import/Form/MapField.php +++ b/CRM/Import/Form/MapField.php @@ -94,8 +94,8 @@ abstract class CRM_Import_Form_MapField extends CRM_Core_Form { /** * Attempt to match header labels with our mapper fields * - * @param header - * @param mapperFields + * @param string $header + * @param array $patterns * * @return string */ @@ -118,8 +118,8 @@ abstract class CRM_Import_Form_MapField extends CRM_Core_Form { /** * Guess at the field names given the data and patterns from the schema * - * @param patterns - * @param index + * @param array $patterns + * @param string $index * * @return string */ diff --git a/CRM/Mailing/Form/Component.php b/CRM/Mailing/Form/Component.php index 256057482a..28b907b2a0 100644 --- a/CRM/Mailing/Form/Component.php +++ b/CRM/Mailing/Form/Component.php @@ -71,7 +71,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { ); $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array( 'CRM_Mailing_DAO_Component', - $this->_id + $this->_id, )); $this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents()); @@ -171,7 +171,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { $errors = array(); foreach (array( 'text', - 'html' + 'html', ) as $type) { $dataErrors = array(); foreach ($InvalidTokens as $token => $desc) { @@ -179,14 +179,14 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { if (preg_match('/' . preg_quote('{' . $token . '}') . '/', $params['body_' . $type])) { $dataErrors[] = '
  • ' . ts('This message is having a invalid token - %1: %2', array( 1 => $token, - 2 => $desc + 2 => $desc, )) . '
  • '; } } } if (!empty($dataErrors)) { $errors['body_' . $type] = ts('The following errors were detected in %1 message:', array( - 1 => $type + 1 => $type, )) . '
    ' . ts('More information on tokens...') . ''; } } diff --git a/CRM/Mailing/Form/Group.php b/CRM/Mailing/Form/Group.php index 2a9a5c50e4..d8cc37d256 100644 --- a/CRM/Mailing/Form/Group.php +++ b/CRM/Mailing/Form/Group.php @@ -55,7 +55,7 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task { if (CRM_Core_BAO_MailSettings::defaultDomain() == "EXAMPLE.ORG") { CRM_Core_Error::fatal(ts('The default mailbox has not been configured. You will find more info in our online user and administrator guide.', array( 1 => CRM_Utils_System::url('civicrm/admin/mailSettings', 'reset=1'), - 2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/" + 2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/", ))); } @@ -224,8 +224,8 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task { //get the mailing groups. $groups = CRM_Core_PseudoConstant::nestedGroup('Mailing'); if ($hiddenMailingGroup) { - $groups[$hiddenMailingGroup] = - CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $hiddenMailingGroup, 'title'); + $groups[$hiddenMailingGroup] + = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $hiddenMailingGroup, 'title'); } $mailings = CRM_Mailing_PseudoConstant::completed(); @@ -243,7 +243,7 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task { $this->add('select', 'baseGroup', ts('Unsubscription Group'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + CRM_Contact_BAO_Group::getGroupsHierarchy($staticGroups, NULL, '  ', TRUE), TRUE, array('class' => 'crm-select2 huge') @@ -392,7 +392,7 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task { 'campaign_id', 'dedupe_email', 'location_type_id', - 'email_selection_method' + 'email_selection_method', ) as $n ) { if (!empty($values[$n])) { diff --git a/CRM/Mailing/Form/Upload.php b/CRM/Mailing/Form/Upload.php index 6d310f4ca8..639cf3c3d9 100644 --- a/CRM/Mailing/Form/Upload.php +++ b/CRM/Mailing/Form/Upload.php @@ -231,7 +231,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form { $this->add('select', 'from_email_address', ts('From Email Address'), array( - '' => '- select -' + '' => '- select -', ) + $fromEmailAddress, TRUE ); @@ -558,7 +558,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form { // set $header and $footer foreach (array( 'header', - 'footer' + 'footer', ) as $part) { $$part = array(); if ($params["{$part}_id"]) { @@ -598,7 +598,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form { foreach (array( 'text', - 'html' + 'html', ) as $file) { if (!$params['upload_type'] && !file_exists(CRM_Utils_Array::value('tmp_name', $files[$file . 'File']))) { continue; @@ -667,7 +667,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form { } if (!empty($dataErrors)) { $errors[$file . 'File'] = ts('The following errors were detected in %1:', array( - 1 => $name + 1 => $name, )) . '
    ' . ts('More information on required tokens...') . ''; } } diff --git a/CRM/Mailing/MailStore/Maildir.php b/CRM/Mailing/MailStore/Maildir.php index 81fb503f66..980451239e 100644 --- a/CRM/Mailing/MailStore/Maildir.php +++ b/CRM/Mailing/MailStore/Maildir.php @@ -56,13 +56,13 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore { 'CiviMail.ignored', date('Y'), date('m'), - date('d') + date('d'), ))); $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array( 'CiviMail.processed', date('Y'), date('m'), - date('d') + date('d'), ))); } @@ -78,13 +78,13 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore { */ public function fetchNext($count = 0) { $mails = array(); - $parser = new ezcMailParser; + $parser = new ezcMailParser(); //set property text attachment as file CRM-5408 $parser->options->parseTextAttachmentsAsFiles = TRUE; foreach (array( 'cur', - 'new' + 'new', ) as $subdir) { $dir = $this->_dir . DIRECTORY_SEPARATOR . $subdir; foreach (scandir($dir) as $file) { diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 31f146fda9..4af96fa0fe 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -471,7 +471,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { if ($this->_context == 'standalone') { $this->addEntityRef('contact_id', ts('Contact'), array( 'create' => TRUE, - 'api' => array('extra' => array('email')) + 'api' => array('extra' => array('email')), ), TRUE); } @@ -576,7 +576,7 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; } $memTypeJs = array( 'onChange' => - "CRM.buildCustomData( 'Membership', this.value ); buildAutoRenew(this.value, null );", + "CRM.buildCustomData( 'Membership', this.value ); buildAutoRenew(this.value, null );", ); } } @@ -1220,7 +1220,7 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; if (empty($formValues['source'])) { $params['contribution_source'] = ts('%1 Membership: Offline signup (by %2)', array( 1 => $membershipType, - 2 => $userName + 2 => $userName, )); } else { @@ -1722,7 +1722,7 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; * @param object $membership * Object. * - * @return boolean + * @return bool * true if mail was sent successfully */ public static function emailReceipt(&$form, &$formValues, &$membership) { diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index e9a0a73db6..92be25bc74 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -535,13 +535,12 @@ AND li.entity_id = {$entityId} * @param array $lineItemId * An assoc array of lineItem. * - * @return number|void + * @return int|void * tax rate - * */ public static function calculateTaxRate($lineItemId) { if ($lineItemId['unit_price'] == 0) { - return; + return FALSE; } if ($lineItemId['html_type'] == 'Text') { $tax = $lineItemId['tax_amount'] / ($lineItemId['unit_price'] * $lineItemId['qty']) * 100; diff --git a/CRM/Price/Form/DeleteField.php b/CRM/Price/Form/DeleteField.php index 9818907759..ae52050841 100644 --- a/CRM/Price/Form/DeleteField.php +++ b/CRM/Price/Form/DeleteField.php @@ -55,12 +55,10 @@ class CRM_Price_Form_DeleteField extends CRM_Core_Form { /** * Set up variables to build the form * - * @param null - * * @return void * @acess protected */ - function preProcess() { + public function preProcess() { $this->_fid = $this->get('fid'); $this->_title = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', @@ -76,8 +74,6 @@ class CRM_Price_Form_DeleteField extends CRM_Core_Form { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -98,12 +94,9 @@ class CRM_Price_Form_DeleteField extends CRM_Core_Form { /** * Process the form when submitted * - * @param null - * * @return void */ public function postProcess() { - if (CRM_Price_BAO_PriceField::deleteField($this->_fid)) { CRM_Core_Session::setStatus(ts('The Price Field \'%1\' has been deleted.', array(1 => $this->_title)), '', 'success'); } diff --git a/CRM/Price/Form/DeleteSet.php b/CRM/Price/Form/DeleteSet.php index d3c330a02a..2fbdefb0f9 100644 --- a/CRM/Price/Form/DeleteSet.php +++ b/CRM/Price/Form/DeleteSet.php @@ -58,7 +58,7 @@ class CRM_Price_Form_DeleteSet extends CRM_Core_Form { * @return void * @access protected */ - function preProcess() { + public function preProcess() { $this->_sid = $this->get('sid'); $this->_title = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', diff --git a/CRM/Price/Page/Field.php b/CRM/Price/Page/Field.php index a6513dafdd..845ee59eaa 100644 --- a/CRM/Price/Page/Field.php +++ b/CRM/Price/Page/Field.php @@ -69,12 +69,10 @@ class CRM_Price_Page_Field 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 */ - function &actionLinks() { + public function &actionLinks() { if (!isset(self::$_actionLinks)) { self::$_actionLinks = array( CRM_Core_Action::UPDATE => array( @@ -113,8 +111,6 @@ class CRM_Price_Page_Field extends CRM_Core_Page { /** * Browse all price set fields. * - * @param null - * * @return void */ public function browse() { @@ -241,8 +237,6 @@ class CRM_Price_Page_Field 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() { diff --git a/CRM/Report/BAO/Hook.php b/CRM/Report/BAO/Hook.php index 36256311c1..711933bc3c 100644 --- a/CRM/Report/BAO/Hook.php +++ b/CRM/Report/BAO/Hook.php @@ -91,10 +91,12 @@ class CRM_Report_BAO_Hook { $contactIdClause = $join = ''; foreach (self::getSearchQueryObjects() as $obj) { list($cidClause, $joinClause) = $obj->logDiffClause($reportObj, $table); - if ($joinClause) + if ($joinClause) { $join .= $joinClause; - if ($cidClause) + } + if ($cidClause) { $contactIdClause .= $cidClause; + } } return array($contactIdClause, $join); } diff --git a/CRM/Upgrade/Controller.php b/CRM/Upgrade/Controller.php index ce68ebc94d..b35d674860 100644 --- a/CRM/Upgrade/Controller.php +++ b/CRM/Upgrade/Controller.php @@ -37,7 +37,7 @@ class CRM_Upgrade_Controller extends CRM_Core_Controller { /** * Class constructor */ - function __construct( + public function __construct( $title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE diff --git a/CRM/Utils/Hook/UnitTests.php b/CRM/Utils/Hook/UnitTests.php index 94b3c7955c..72f1c46f37 100644 --- a/CRM/Utils/Hook/UnitTests.php +++ b/CRM/Utils/Hook/UnitTests.php @@ -105,7 +105,7 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { * * @return mixed */ - function invoke( + public function invoke( $numParams, &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6, $fnSuffix) { diff --git a/CRM/Utils/Weight.php b/CRM/Utils/Weight.php index 7f823e6d2f..13cdec8f33 100644 --- a/CRM/Utils/Weight.php +++ b/CRM/Utils/Weight.php @@ -291,7 +291,7 @@ class CRM_Utils_Weight { * @return CRM_Core_DAO * objet that holds the results of the query */ - static function &query( + public static function &query( $queryType, $daoName, $fieldValues = NULL, diff --git a/api/v3/Country.php b/api/v3/Country.php index 19eff2160c..647e8aa717 100644 --- a/api/v3/Country.php +++ b/api/v3/Country.php @@ -73,9 +73,9 @@ function _civicrm_api3_country_create_spec(&$params) { * * @example CountryDelete.php Standard Delete Example * - * @return boolean + * @return bool * | error true if successfull, error otherwise - * {@getfields country_delete} + * {@getfields country_delete} */ function civicrm_api3_country_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_DAO(__FUNCTION__), $params); @@ -84,9 +84,6 @@ function civicrm_api3_country_delete($params) { /** * Retrieve one or more countrys * - * @param array input parameters - * - * * @example CountryGet.php Standard Get Example * * @param array $params @@ -94,7 +91,7 @@ function civicrm_api3_country_delete($params) { * * @return array * api result array - * {@getfields country_get} + * {@getfields country_get} */ function civicrm_api3_country_get($params) { diff --git a/api/v3/LocationType.php b/api/v3/LocationType.php index 1e01f5a94b..73568b998f 100644 --- a/api/v3/LocationType.php +++ b/api/v3/LocationType.php @@ -46,7 +46,7 @@ * * @return array * API result array - * {@getfields email_create} + * {@getfields email_create} */ function civicrm_api3_location_type_create($params) { //set display_name equal to name if it's not defined @@ -78,7 +78,7 @@ function _civicrm_api3_location_type_create_spec(&$params) { * * @return array * API result array - * {@getfields LocationType_delete} + * {@getfields LocationType_delete} */ function civicrm_api3_location_type_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -87,9 +87,6 @@ function civicrm_api3_location_type_delete($params) { /** * Retrieve one or more Location Types * - * @param array input parameters - * - * * @example LocationTypeGet.php Standard Get Example * * @param array $params @@ -97,7 +94,7 @@ function civicrm_api3_location_type_delete($params) { * * @return array * api result - * {@getfields LocationType_get} + * {@getfields LocationType_get} */ function civicrm_api3_location_type_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/utils.php b/api/v3/utils.php index 0e04b694b7..41ca0a5a8d 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -1847,7 +1847,7 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent // Check our field length if (is_string($fieldValue) && !empty($fieldInfo['maxlength']) && strlen($fieldValue) > $fieldInfo['maxlength'] ) { - throw new API_Exception( $fieldValue . " is " . strlen($fieldValue) . " characters - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters', + throw new API_Exception($fieldValue . " is " . strlen($fieldValue) . " characters - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters', 2100, array('field' => $fieldName, "max_length" => $fieldInfo['maxlength']) ); } diff --git a/bin/csv/import.php b/bin/csv/import.php index 3495865184..e0dd258b04 100644 --- a/bin/csv/import.php +++ b/bin/csv/import.php @@ -30,7 +30,7 @@ * php bin/csv/import.php -e --file /path/to/csv/file [ -s site.org ] * e.g.: php bin/csv/import.php -e Contact --file /tmp/import.csv * - **/ + */ require_once dirname(__DIR__) . '/cli.class.php'; $entityImporter = new civicrm_cli_csv_importer(); diff --git a/bin/deprecated/CiviReportMail.php b/bin/deprecated/CiviReportMail.php index 28db57bb8f..38d0ccd5de 100644 --- a/bin/deprecated/CiviReportMail.php +++ b/bin/deprecated/CiviReportMail.php @@ -32,7 +32,7 @@ class CiviReportMail { /** */ - function __construct() { + public function __construct() { $this->initialize(); CRM_Utils_System::authenticateScript(TRUE); @@ -41,14 +41,14 @@ class CiviReportMail { CRM_Core_Error::debug_log_message('CiviReportMail.php'); } - function initialize() { + public function initialize() { require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; $config = CRM_Core_Config::singleton(); } - function run() { + public function run() { require_once 'CRM/Core/Lock.php'; $lock = new CRM_Core_Lock('CiviReportMail'); @@ -72,5 +72,5 @@ class CiviReportMail { } session_start(); -$obj = new CiviReportMail; +$obj = new CiviReportMail(); $obj->run(); diff --git a/bin/deprecated/UpdateGreeting.php b/bin/deprecated/UpdateGreeting.php index d285a00f96..7414842aca 100644 --- a/bin/deprecated/UpdateGreeting.php +++ b/bin/deprecated/UpdateGreeting.php @@ -44,7 +44,7 @@ class CRM_UpdateGreeting { /** */ - function __construct() { + public function __construct() { $this->initialize(); $config = CRM_Core_Config::singleton(); @@ -60,7 +60,7 @@ class CRM_UpdateGreeting { CRM_Core_Error::debug_log_message('UpdateGreeting.php'); } - function initialize() { + public function initialize() { require_once '../../civicrm.config.php'; require_once 'CRM/Core/Config.php'; } @@ -85,7 +85,7 @@ class CRM_UpdateGreeting { if (in_array($greeting, array( 'email_greeting', - 'postal_greeting' + 'postal_greeting', )) && $contactType == 'Organization' ) { CRM_Core_Error::fatal(ts('You cannot use %1 for contact type %2.', array(1 => $greeting, 2 => $contactType))); @@ -130,7 +130,7 @@ class CRM_UpdateGreeting { $processAll = $processOnlyIdSet = FALSE; if (in_array($force, array( 1, - 'true' + 'true', ))) { $processAll = TRUE; } diff --git a/tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php b/tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php index 0a26e40e63..0728f87302 100644 --- a/tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php +++ b/tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php @@ -32,7 +32,7 @@ class CRM_Mailing_BAO_QueryTestDataProvider implements Iterator { 'fv' => array( 'mailing_name' => 'First%', 'mailing_delivery_status' - => 'N' + => 'N', ), 'id' => array(105), ), @@ -41,7 +41,7 @@ class CRM_Mailing_BAO_QueryTestDataProvider implements Iterator { 'fv' => array( 'mailing_name' => 'First%', 'mailing_delivery_status' - => 'Y' + => 'Y', ), 'id' => array(102, 103, 104, 108, 109, 110, 111, 112), ), @@ -66,7 +66,7 @@ class CRM_Mailing_BAO_QueryTestDataProvider implements Iterator { 'fv' => array( 'mailing_name' => 'Second%', 'mailing_delivery_status' - => 'N' + => 'N', ), 'id' => array(), ), @@ -75,7 +75,7 @@ class CRM_Mailing_BAO_QueryTestDataProvider implements Iterator { 'fv' => array( 'mailing_name' => 'Second%', 'mailing_delivery_status' - => 'Y' + => 'Y', ), 'id' => array(102, 103, 104, 108, 109, 110, 111, 112), ), diff --git a/tests/phpunit/CRM/Queue/AllTests.php b/tests/phpunit/CRM/Queue/AllTests.php index c94da90e3d..6005e476cb 100644 --- a/tests/phpunit/CRM/Queue/AllTests.php +++ b/tests/phpunit/CRM/Queue/AllTests.php @@ -47,7 +47,7 @@ class CRM_Queue_AllTests extends CiviTestSuite { */ private static function getInstance() { if (is_null(self::$instance)) { - self::$instance = new self; + self::$instance = new CRM_Queue_AllTests(); } return self::$instance; } diff --git a/tests/phpunit/CRM/Queue/Queue/SqlTest.php b/tests/phpunit/CRM/Queue/Queue/SqlTest.php index fe67bbbef8..6b6982e5d8 100644 --- a/tests/phpunit/CRM/Queue/Queue/SqlTest.php +++ b/tests/phpunit/CRM/Queue/Queue/SqlTest.php @@ -48,12 +48,15 @@ class CRM_Queue_Queue_SqlTest extends CiviUnitTestCase { array( 'type' => 'Sql', 'name' => 'test-queue', - ) + ), ); return $queueSpecs; } - /* ----------------------- Per-provider tests ----------------------- */ + /** + * Per-provider tests + * + */ public function setUp() { parent::setUp(); $this->queueService = CRM_Queue_Service::singleton(TRUE); diff --git a/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php b/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php index 684f30463e..167d9e0751 100644 --- a/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php +++ b/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php @@ -34,7 +34,7 @@ class TransactionSubscriberTest extends \CiviUnitTestCase { array('is_transactional' => TRUE, 'options' => array('force_rollback' => TRUE)), TRUE, TRUE, - TRUE + TRUE, ); $r[] = array( 3, @@ -43,7 +43,7 @@ class TransactionSubscriberTest extends \CiviUnitTestCase { array('is_transactional' => TRUE, 'options' => array('force_rollback' => FALSE)), TRUE, FALSE, - FALSE + FALSE, ); $r[] = array( 3, @@ -52,7 +52,7 @@ class TransactionSubscriberTest extends \CiviUnitTestCase { array('is_transactional' => FALSE, 'options' => array('force_rollback' => TRUE)), TRUE, TRUE, - TRUE + TRUE, ); $r[] = array( 3, @@ -61,7 +61,7 @@ class TransactionSubscriberTest extends \CiviUnitTestCase { array('is_transactional' => FALSE, 'options' => array('force_rollback' => FALSE)), FALSE, FALSE, - FALSE + FALSE, ); $r[] = array(4, 'Widget', 'get', array(), FALSE, FALSE, FALSE); diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 3584c546f5..c2b6bbee70 100755 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -1810,7 +1810,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { /** * Delete a Location Type * - * @param int locationTypeId + * @param int $locationTypeId */ public function locationTypeDelete($locationTypeId) { $locationType = new CRM_Core_DAO_LocationType(); @@ -2025,7 +2025,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { */ public function activityTypeCreate($params) { return $this->callAPISuccess('ActivityType', 'create', $params); - } + } /** * Delete activity type @@ -2037,7 +2037,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { public function activityTypeDelete($activityTypeId) { $params['activity_type_id'] = $activityTypeId; return $this->callAPISuccess('ActivityType', 'delete', $params); - } + } /** * Create custom group @@ -3100,7 +3100,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * There is another function to this effect on the PaypalPro test but it appears to be silently failing * & the best protection agains that is the functions this class affords * @param array $params - * @return + * @return int $result['id'] payment processor id */ public function paymentProcessorCreate($params = array()) { $params = array_merge(array( diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php index 6dd8abadec..27256eb8a0 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php @@ -133,7 +133,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { 'CiviPledge' => array('pledge_frequency_interval', 'addPledgeSearchDetail'), 'relationship' => array( "xpath=//div[@id='relationship']/table/tbody/tr//td/label[text()='Relationship Status']/../label[text()='All']", - '' + '', ), ); @@ -171,7 +171,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { $this->waitForText("xpath=//form[@id='Advanced']/div[3]/div/div", "No matches found for"); } - /* + /** * Check for CRM-9873 */ public function testActivitySearchByTypeTest() { @@ -229,7 +229,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { $this->click("xpath=//form[@id='Advanced']//div[2]/div/div[1]"); } - /* + /** * Check for CRM-14952 */ public function testStateSorting() { @@ -248,7 +248,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { "Connecticut", "Georgia", "New Jersey", - "Texas" + "Texas", )); $this->clickLink("_qf_Advanced_refresh", "xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[6]"); diff --git a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php index 4ae3ab5675..e48ade055e 100644 --- a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php +++ b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php @@ -206,7 +206,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { $this->openCiviPage('admin/uf/group/field/add', array( 'action' => 'add', 'reset' => 1, - 'gid' => $gid + 'gid' => $gid, ), 'field_name[0]'); $this->select('field_name[0]', "value=Membership"); diff --git a/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php b/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php index 3d2c9d0358..03f65ac3bf 100644 --- a/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php +++ b/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php @@ -140,7 +140,7 @@ class WebTest_Member_FixedMembershipTypeTest extends CiviSeleniumTestCase { foreach (array( 'joinDate', 'startDate', - 'endDate' + 'endDate', ) as $date) { $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull); } @@ -299,7 +299,7 @@ SELECT end_event_adjust_interval foreach (array( 'joinDate', 'startDate', - 'endDate' + 'endDate', ) as $date) { $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull); } @@ -451,7 +451,7 @@ SELECT end_event_adjust_interval foreach (array( 'joinDate', 'startDate', - 'endDate' + 'endDate', ) as $date) { $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull); } @@ -605,7 +605,7 @@ SELECT end_event_adjust_interval foreach (array( 'joinDate', 'startDate', - 'endDate' + 'endDate', ) as $date) { $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull); } diff --git a/tests/phpunit/api/v3/CaseTest.php b/tests/phpunit/api/v3/CaseTest.php index f284369e96..10d4b9ec6a 100644 --- a/tests/phpunit/api/v3/CaseTest.php +++ b/tests/phpunit/api/v3/CaseTest.php @@ -171,7 +171,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { // Fetch case based on an activity id $result = $this->callAPISuccess('case', 'get', array( 'activity_id' => $activity, - 'return' => 'activities,contacts' + 'return' => 'activities,contacts', )); $this->assertEquals(FALSE, empty($result['values'][$id]), 'in line ' . __LINE__); $this->assertEquals($result['values'][$id], $case, 'in line ' . __LINE__); @@ -191,7 +191,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { // Fetch case based on client contact id $result = $this->callAPISuccess('case', 'get', array( 'client_id' => $this->_params['contact_id'], - 'return' => array('activities', 'contacts') + 'return' => array('activities', 'contacts'), )); $this->assertAPIArrayComparison($result['values'][$id], $case); } @@ -210,7 +210,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { // Fetch case based on client contact id $result = $this->callAPISuccess('case', 'get', array( 'subject' => $this->_params['subject'], - 'return' => array('activities', 'contacts') + 'return' => array('activities', 'contacts'), )); $this->assertAPIArrayComparison($result['values'][$id], $case); } @@ -226,7 +226,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { // Append 'wrong' to subject so that it is no longer the same $result = $this->callAPISuccess('case', 'get', array( 'subject' => $this->_params['subject'] . 'wrong', - 'return' => array('activities', 'contacts') + 'return' => array('activities', 'contacts'), )); $this->assertEquals(0, $result['count'], 'in line ' . __LINE__); } diff --git a/tests/phpunit/api/v3/ContributionSoftTest.php b/tests/phpunit/api/v3/ContributionSoftTest.php index 2bc8cf5dd9..7335251319 100644 --- a/tests/phpunit/api/v3/ContributionSoftTest.php +++ b/tests/phpunit/api/v3/ContributionSoftTest.php @@ -134,7 +134,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { //test get by contact id works $result = $this->callAPISuccess('contribution_soft', 'get', array( - 'contact_id' => $this->_softIndividual2Id + 'contact_id' => $this->_softIndividual2Id, ) ); $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); @@ -155,7 +155,9 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { } - ///////////////// civicrm_contribution_soft + /** + * civicrm_contribution_soft + */ public function testCreateEmptyParamsContributionSoft() { $softcontribution = $this->callAPIFailure('contribution_soft', 'create', array(), 'Mandatory key(s) missing from params array: contribution_id, amount, contact_id' @@ -169,7 +171,6 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { } public function testCreateContributionSoftInvalidContact() { - $params = array( 'contact_id' => 999, 'contribution_id' => $this->_contributionId, @@ -183,7 +184,6 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { } public function testCreateContributionSoftInvalidContributionId() { - $params = array( 'contribution_id' => 999999, 'contact_id' => $this->_softIndividual1Id, @@ -216,7 +216,10 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $this->assertEquals($softcontribution['values'][$softcontribution['id']]['soft_credit_type_id'], 5, 'In line ' . __LINE__); } - //To Update Soft Contribution + /** + * To Update Soft Contribution + * + */ public function testCreateUpdateContributionSoft() { //create a soft credit $params = array( @@ -277,7 +280,10 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $result = $this->callAPISuccess('contribution_soft', 'delete', $params); } - ///////////////// civicrm_contribution_soft_delete methods + /** + * civicrm_contribution_soft_delete methods + * + */ public function testDeleteEmptyParamsContributionSoft() { $params = array(); $softcontribution = $this->callAPIFailure('contribution_soft', 'delete', $params); diff --git a/tests/phpunit/api/v3/TaxContributionPageTest.php b/tests/phpunit/api/v3/TaxContributionPageTest.php index 66e53b769a..81b7d4ca61 100644 --- a/tests/phpunit/api/v3/TaxContributionPageTest.php +++ b/tests/phpunit/api/v3/TaxContributionPageTest.php @@ -361,7 +361,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $this->_checkFinancialRecords($contribution, 'pending'); } - /* + /** * Updation of contrbution * Function tests that line items, financial records are updated when contribution amount is changed */ -- 2.25.1