From 28a04ea9fb1e95df696b2545bca3f35bafc6b409 Mon Sep 17 00:00:00 2001 From: pratikshad Date: Fri, 16 Jan 2015 11:06:39 +0530 Subject: [PATCH] Clean up code for batch 19 --- CRM/ACL/BAO/ACL.php | 6 +++--- CRM/ACL/Form/ACLBasic.php | 6 +++--- CRM/Activity/BAO/Query.php | 11 ++++++----- CRM/Activity/Form/Task/RemoveFromTag.php | 6 +++--- CRM/Admin/Form/PaymentProcessor.php | 6 +++--- CRM/Admin/Form/Setting/Miscellaneous.php | 5 ++--- CRM/Admin/Form/Setting/Search.php | 8 ++++---- CRM/Campaign/Form/Search/Campaign.php | 6 +++--- CRM/Campaign/Form/Survey.php | 15 ++++++--------- CRM/Campaign/Form/SurveyType.php | 6 +----- CRM/Campaign/Form/Task/Release.php | 6 +++--- CRM/Campaign/Page/Vote.php | 6 +++--- CRM/Campaign/Selector/Search.php | 7 +++---- CRM/Case/Form/Case.php | 5 ++--- CRM/Case/Page/Tab.php | 8 +++----- CRM/Contact/BAO/Contact/Location.php | 5 +---- CRM/Contact/BAO/RelationshipType.php | 5 ++--- CRM/Contact/BAO/SearchCustom.php | 1 - CRM/Contact/Page/DedupeFind.php | 2 +- CRM/Contribute/Page/DashBoard.php | 2 +- CRM/Core/Lock.php | 2 +- CRM/Event/Cart/Form/Checkout/Payment.php | 2 +- CRM/Event/Form/ManageEvent/Conference.php | 2 +- CRM/Event/Form/Task/Batch.php | 3 +-- CRM/Friend/BAO/Friend.php | 2 +- CRM/Profile/Form/Search.php | 2 +- CRM/Queue/ErrorPolicy.php | 4 ++-- CRM/Report/Form/Contribute/SoftCredit.php | 3 +-- .../Snapshot/V4p2/Price/BAO/FieldValue.php | 6 +++--- CRM/Utils/Pager.php | 6 ++---- CRM/Utils/System/Drupal8.php | 4 +--- CRM/Utils/VersionCheck.php | 6 +++--- api/v3/Activity.php | 2 +- api/v3/CustomSearch.php | 6 +++--- api/v3/Domain.php | 6 +++--- api/v3/Grant.php | 6 +++--- api/v3/LocBlock.php | 6 +++--- api/v3/MailSettings.php | 6 +++--- api/v3/MailingContact.php | 4 ++-- api/v3/MailingEventSubscribe.php | 5 ++--- api/v3/Phone.php | 2 +- api/v3/PriceFieldValue.php | 6 +++--- api/v3/PriceSet.php | 6 +++--- api/v3/Survey.php | 6 +++--- api/v3/Tag.php | 6 +++--- api/v3/UFField.php | 6 +++--- bin/deprecated/RespondentProcessor.php | 2 +- .../test.extension.manager.reporttest/main.php | 6 +++--- .../CRM/Contact/BAO/GroupContactCacheTest.php | 6 +++--- tests/phpunit/CRM/Core/MenuTest.php | 6 +++--- .../CRM/Core/Payment/AuthorizeNetIPNTest.php | 6 +++--- tests/phpunit/CRM/Core/PseudoConstantTest.php | 6 +++--- tests/phpunit/CRM/Queue/QueueTest.php | 8 +++++--- tests/phpunit/CRM/Utils/API/MatchOptionTest.php | 6 +++--- tests/phpunit/CRM/Utils/Cache/AllTests.php | 2 +- tests/phpunit/CiviTest/Custom.php | 4 +--- tests/phpunit/CiviTest/Event.php | 2 +- tests/phpunit/CiviTest/PaypalPro.php | 6 +++--- tests/phpunit/WebTest/Event/AddEventTest.php | 3 +-- .../phpunit/WebTest/Import/ContactSubtypeTest.php | 6 +++--- tests/phpunit/WebTest/Import/ContactTest.php | 6 +++--- .../WebTest/Import/DuplicateMatchingTest.php | 6 +++--- tests/phpunit/api/v3/EntityTagTest.php | 13 +++++++++---- tests/phpunit/api/v3/MembershipTest.php | 10 +++++----- 64 files changed, 161 insertions(+), 180 deletions(-) diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 18b60cdd85..b8cef2a1b3 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -112,7 +112,7 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL { $object_table = NULL, $object_id = NULL, $acl_id = NULL, $acl_role = FALSE ) { - $dao = new CRM_ACL_DAO_ACL; + $dao = new CRM_ACL_DAO_ACL(); $t = array( 'ACL' => self::getTableName(), @@ -821,11 +821,11 @@ SELECT g.* } if ($staticGroupIDs) { - $clauses[] = '( `civicrm_group_contact-ACL`.group_id IN (' . join(', ', $staticGroupIDs) . ') AND `civicrm_group_contact-ACL`.status IN ("Added") )'; + $clauses[] = '( `civicrm_group_contact-ACL`.group_id IN (' . implode(', ', $staticGroupIDs) . ') AND `civicrm_group_contact-ACL`.status IN ("Added") )'; } if ($cachedGroupIDs) { - $clauses[] = '`civicrm_group_contact_cache-ACL`.group_id IN (' . join(', ', $cachedGroupIDs) . ')'; + $clauses[] = '`civicrm_group_contact_cache-ACL`.group_id IN (' . implode(', ', $cachedGroupIDs) . ')'; } } } diff --git a/CRM/ACL/Form/ACLBasic.php b/CRM/ACL/Form/ACLBasic.php index d38cc2735c..2391478d68 100644 --- a/CRM/ACL/Form/ACLBasic.php +++ b/CRM/ACL/Form/ACLBasic.php @@ -95,9 +95,9 @@ SELECT object_table $label = ts('Role'); $role = array( - '-1' => ts('- select role -'), - '0' => ts('Everyone'), - ) + CRM_Core_OptionGroup::values('acl_role'); + '-1' => ts('- select role -'), + '0' => ts('Everyone'), + ) + CRM_Core_OptionGroup::values('acl_role'); $entityID = &$this->add('select', 'entity_id', $label, $role, TRUE); if ($this->_id) { diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index cdc2ff6bf8..2e9213e5f6 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -460,11 +460,12 @@ class CRM_Activity_BAO_Query { CRM_Core_Form_Tag::buildQuickForm($form, $parentNames, 'civicrm_activity', NULL, TRUE, TRUE); $surveys = CRM_Campaign_BAO_Survey::getSurveys(TRUE, FALSE, FALSE, TRUE); - if ($surveys) $form->add('select', 'activity_survey_id', ts('Survey / Petition'), - array('' => ts('- none -')) + $surveys, FALSE, - array('class' => 'crm-select2') - ); - + if ($surveys) { + $form->add('select', 'activity_survey_id', ts('Survey / Petition'), + array('' => ts('- none -')) + $surveys, FALSE, + array('class' => 'crm-select2') + ); + } $extends = array('Activity'); $groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends); if ($groupDetails) { diff --git a/CRM/Activity/Form/Task/RemoveFromTag.php b/CRM/Activity/Form/Task/RemoveFromTag.php index c97fb65285..1e67b893f2 100644 --- a/CRM/Activity/Form/Task/RemoveFromTag.php +++ b/CRM/Activity/Form/Task/RemoveFromTag.php @@ -137,13 +137,13 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task { $status = array( ts('%count activities un-tagged', array( 'count' => $removed, - 'plural' => '%count activities un-tagged' - )) + 'plural' => '%count activities un-tagged', + )), ); if ($notRemoved) { $status[] = ts('1 activity already did not have this tag', array( 'count' => $notRemoved, - 'plural' => '%count activities already did not have this tag' + 'plural' => '%count activities already did not have this tag', )); } $status = ''; diff --git a/CRM/Admin/Form/PaymentProcessor.php b/CRM/Admin/Form/PaymentProcessor.php index 1afa4544c8..247f7880ba 100644 --- a/CRM/Admin/Form/PaymentProcessor.php +++ b/CRM/Admin/Form/PaymentProcessor.php @@ -183,7 +183,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array( 'CRM_Financial_DAO_PaymentProcessor', - $this->_id + $this->_id, )); $this->add('text', 'description', ts('Description'), @@ -348,7 +348,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { if ($this->_action & CRM_Core_Action::DELETE) { CRM_Financial_BAO_PaymentProcessor::del($this->_id); CRM_Core_Session::setStatus("", ts('Payment Processor Deleted.'), "success"); - return; + return NULL; } $values = $this->controller->exportValues($this->_name); @@ -371,7 +371,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { * @param int $domainID * @param $test * - * @return Void + * @return void */ public function updatePaymentProcessor(&$values, $domainID, $test) { $dao = new CRM_Financial_DAO_PaymentProcessor(); diff --git a/CRM/Admin/Form/Setting/Miscellaneous.php b/CRM/Admin/Form/Setting/Miscellaneous.php index fc964512d7..77008585f0 100644 --- a/CRM/Admin/Form/Setting/Miscellaneous.php +++ b/CRM/Admin/Form/Setting/Miscellaneous.php @@ -58,7 +58,6 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting { /** * Basic setup */ - public function preProcess() { $config = CRM_Core_Config::singleton(); $this->_uploadMaxSize = (int) ini_get('upload_max_filesize'); @@ -78,7 +77,7 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting { $validTriggerPermission = CRM_Core_DAO::checkTriggerViewPermission(FALSE); // FIXME: for now, disable logging for multilingual sites OR if triggers are not permittted - $domain = new CRM_Core_DAO_Domain; + $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); $attribs = $domain->locales || !$validTriggerPermission ? array('disabled' => 'disabled') : array(); @@ -166,7 +165,7 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting { parent::postProcess(); if ($config->logging != $values['logging']) { - $logging = new CRM_Logging_Schema; + $logging = new CRM_Logging_Schema(); if ($values['logging']) { $logging->enableLogging(); } diff --git a/CRM/Admin/Form/Setting/Search.php b/CRM/Admin/Form/Setting/Search.php index 8e78680315..aaa858c558 100644 --- a/CRM/Admin/Form/Setting/Search.php +++ b/CRM/Admin/Form/Setting/Search.php @@ -72,8 +72,8 @@ class CRM_Admin_Form_Setting_Search extends CRM_Admin_Form_Setting { // Autocomplete for Contact Search (quick search etc.) $options = array( - ts('Contact Name') => 1 - ) + array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options', + ts('Contact Name') => 1, + ) + array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options', FALSE, FALSE, TRUE )); $this->addCheckBox('autocompleteContactSearch', ts('Autocomplete Contact Search'), $options, @@ -84,8 +84,8 @@ class CRM_Admin_Form_Setting_Search extends CRM_Admin_Form_Setting { // Autocomplete for Contact Reference (custom fields) $optionsCR = array( - ts('Contact Name') => 1 - ) + array_flip(CRM_Core_OptionGroup::values('contact_reference_options', + ts('Contact Name') => 1, + ) + array_flip(CRM_Core_OptionGroup::values('contact_reference_options', FALSE, FALSE, TRUE )); $this->addCheckBox('autocompleteContactReference', ts('Contact Reference Options'), $optionsCR, diff --git a/CRM/Campaign/Form/Search/Campaign.php b/CRM/Campaign/Form/Search/Campaign.php index c210b70c95..f909e34bd6 100755 --- a/CRM/Campaign/Form/Search/Campaign.php +++ b/CRM/Campaign/Form/Search/Campaign.php @@ -50,7 +50,7 @@ class CRM_Campaign_Form_Search_Campaign extends CRM_Core_Form { * * @return void */ - function preProcess() { + public function preProcess() { $this->_search = CRM_Utils_Array::value('search', $_GET); $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE); $this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'campaign'); @@ -95,7 +95,7 @@ class CRM_Campaign_Form_Search_Campaign extends CRM_Core_Form { $campaignTypes = CRM_Campaign_PseudoConstant::campaignType(); $this->add('select', 'campaign_type_id', ts('Campaign Type'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + $campaignTypes ); @@ -106,7 +106,7 @@ class CRM_Campaign_Form_Search_Campaign extends CRM_Core_Form { $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus(); $this->addElement('select', 'status_id', ts('Campaign Status'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + $campaignStatus ); $this->set('campaignStatus', $campaignStatus); diff --git a/CRM/Campaign/Form/Survey.php b/CRM/Campaign/Form/Survey.php index 4d6e5075f4..bf554f725b 100644 --- a/CRM/Campaign/Form/Survey.php +++ b/CRM/Campaign/Form/Survey.php @@ -92,8 +92,6 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -128,11 +126,10 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form { ), ); } - $buttons[] = - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ); + $buttons[] = array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ); $this->addButtons($buttons); $url = CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey'); @@ -151,10 +148,10 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form { $this->postProcessHook(); - if ($this->_action & CRM_Core_Action::ADD) + if ($this->_action & CRM_Core_Action::ADD) { CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/survey/configure/questions", "action=update&reset=1&id={$this->_surveyId}")); - + } if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_done") { CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey')); } diff --git a/CRM/Campaign/Form/SurveyType.php b/CRM/Campaign/Form/SurveyType.php index 2d57b2298e..a1e41ccd71 100644 --- a/CRM/Campaign/Form/SurveyType.php +++ b/CRM/Campaign/Form/SurveyType.php @@ -64,11 +64,9 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form { /** * Set variables up before form is built * - * @param null - * * @return void */ - function preProcess() { + public function preProcess() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this); if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::DELETE)) { @@ -98,8 +96,6 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form { * Set default values for the form. * the default values are retrieved from the database. * - * @param null - * * @return array * array of default values */ diff --git a/CRM/Campaign/Form/Task/Release.php b/CRM/Campaign/Form/Task/Release.php index bbb84df5e2..cb408656a6 100644 --- a/CRM/Campaign/Form/Task/Release.php +++ b/CRM/Campaign/Form/Task/Release.php @@ -67,14 +67,14 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task { * * @return void */ - function preProcess() { + public function preProcess() { $this->_interviewToRelease = $this->get('interviewToRelease'); if ($this->_interviewToRelease) { //user came from interview form. foreach (array( 'surveyId', 'contactIds', - 'interviewerId' + 'interviewerId', ) as $fld) { $this->{"_$fld"} = $this->get($fld); } @@ -107,7 +107,7 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task { $activityStatus = CRM_Core_PseudoConstant::activityStatus('name'); $statusIds = array(); foreach (array( - 'Scheduled' + 'Scheduled', ) as $name) { if ($statusId = array_search($name, $activityStatus)) { $statusIds[] = $statusId; diff --git a/CRM/Campaign/Page/Vote.php b/CRM/Campaign/Page/Vote.php index c322e9cd3b..2ff97eed26 100644 --- a/CRM/Campaign/Page/Vote.php +++ b/CRM/Campaign/Page/Vote.php @@ -98,7 +98,7 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page { ->addSetting(array( 'tabSettings' => array( 'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'reserve')), - ) + ), )); } @@ -119,8 +119,8 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page { array( 'manage campaign', 'administer CiviCampaign', - "{$name} campaign contacts" - ) + "{$name} campaign contacts", + ), )) ) { continue; diff --git a/CRM/Campaign/Selector/Search.php b/CRM/Campaign/Selector/Search.php index 6928b2c23b..71dac101b4 100755 --- a/CRM/Campaign/Selector/Search.php +++ b/CRM/Campaign/Selector/Search.php @@ -145,7 +145,7 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM * * @return \CRM_Campaign_Selector_Search */ - function __construct( + public function __construct( &$queryParams, $action = CRM_Core_Action::NONE, $surveyClause = NULL, @@ -183,8 +183,7 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM * * @return array */ - static - public function &links() { + static public function &links() { return self::$_links = array(); } @@ -307,7 +306,7 @@ FROM {$from} /** * @return array * which contains an array of strings - **/ + */ public function getQILL() { return $this->_query->qill(); } diff --git a/CRM/Case/Form/Case.php b/CRM/Case/Form/Case.php index c065454fee..a324b78ff0 100644 --- a/CRM/Case/Form/Case.php +++ b/CRM/Case/Form/Case.php @@ -159,8 +159,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form { CRM_Core_Error::fatal(ts('You are not authorized to access this page.')); } - if ($this->_activityTypeFile = - CRM_Activity_BAO_Activity::getFileForActivityTypeId($this->_activityTypeId, + if ($this->_activityTypeFile = CRM_Activity_BAO_Activity::getFileForActivityTypeId($this->_activityTypeId, 'Case' ) ) { @@ -261,7 +260,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form { } $this->add('text', 'activity_subject', ts('Subject'), array_merge($s, array( - 'maxlength' => '128' + 'maxlength' => '128', )), TRUE ); diff --git a/CRM/Case/Page/Tab.php b/CRM/Case/Page/Tab.php index f02272dc48..6eeecf3b84 100644 --- a/CRM/Case/Page/Tab.php +++ b/CRM/Case/Page/Tab.php @@ -117,8 +117,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { $this->assign('caseId', $this->_id); $output = CRM_Core_Selector_Controller::SESSION; $selector = new CRM_Activity_Selector_Activity($this->_contactId, $this->_permission, FALSE, 'case'); - $controller = - new CRM_Core_Selector_Controller( + $controller = new CRM_Core_Selector_Controller( $selector, $this->get(CRM_Utils_Pager::PAGE_ID), NULL, @@ -140,7 +139,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { /** * called when action is browse * - * @return null + * @return void */ public function browse() { @@ -225,8 +224,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { * @return array * (reference) of action links */ - static - public function &links() { + static public function &links() { $config = CRM_Core_Config::singleton(); if (!(self::$_links)) { diff --git a/CRM/Contact/BAO/Contact/Location.php b/CRM/Contact/BAO/Contact/Location.php index 665dcd9969..63d6ee122a 100644 --- a/CRM/Contact/BAO/Contact/Location.php +++ b/CRM/Contact/BAO/Contact/Location.php @@ -52,7 +52,6 @@ class CRM_Contact_BAO_Contact_Location { $primaryClause = " AND civicrm_email.is_primary = 1"; } - $locationClause = NULL; if ($locationTypeID) { $locationClause = " AND civicrm_email.location_type_id = $locationTypeID"; @@ -96,7 +95,6 @@ WHERE civicrm_contact.id = %1"; $cond = " AND civicrm_phone.phone_type_id = '$type'"; } - $sql = " SELECT civicrm_contact.display_name, civicrm_phone.phone, civicrm_contact.do_not_sms FROM civicrm_contact @@ -197,8 +195,7 @@ AND civicrm_contact.id IN $idString "; $location['displayAddress'] = str_replace('
', ', ', addslashes($address)); $location['url'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $dao->contact_id); $location['location_type'] = $dao->location_type; - $location['image'] = CRM_Contact_BAO_Contact_Utils::getImage(isset($dao->contact_sub_type) ? - $dao->contact_sub_type : $dao->contact_type, $imageUrlOnly, $dao->contact_id + $location['image'] = CRM_Contact_BAO_Contact_Utils::getImage(isset($dao->contact_sub_type) ? $dao->contact_sub_type : $dao->contact_type, $imageUrlOnly, $dao->contact_id ); $locations[] = $location; } diff --git a/CRM/Contact/BAO/RelationshipType.php b/CRM/Contact/BAO/RelationshipType.php index 39b0e96512..d3327a7685 100644 --- a/CRM/Contact/BAO/RelationshipType.php +++ b/CRM/Contact/BAO/RelationshipType.php @@ -147,7 +147,6 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType throw new CRM_Core_Exception(ts('Invalid relationship type')); } - //check dependencies // delete all relationships @@ -164,8 +163,8 @@ UPDATE civicrm_membership_type $params = array( 1 => array( CRM_Core_DAO::VALUE_SEPARATOR . $relationshipTypeId . CRM_Core_DAO::VALUE_SEPARATOR, - 'String' - ) + 'String', + ), ); CRM_Core_DAO::executeQuery($query, $params); diff --git a/CRM/Contact/BAO/SearchCustom.php b/CRM/Contact/BAO/SearchCustom.php index 1ea22a7d2d..849277c34c 100644 --- a/CRM/Contact/BAO/SearchCustom.php +++ b/CRM/Contact/BAO/SearchCustom.php @@ -161,7 +161,6 @@ class CRM_Contact_BAO_SearchCustom { $from = $customClass->from(); $where = $customClass->where(); - return array($from, $where); } } diff --git a/CRM/Contact/Page/DedupeFind.php b/CRM/Contact/Page/DedupeFind.php index 36c9348507..a1a965f666 100644 --- a/CRM/Contact/Page/DedupeFind.php +++ b/CRM/Contact/Page/DedupeFind.php @@ -51,7 +51,7 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic { /** * Get action Links * - * @return array + * @return void * (reference) of action links */ public function &links() { diff --git a/CRM/Contribute/Page/DashBoard.php b/CRM/Contribute/Page/DashBoard.php index 518f9e909c..559e5275e7 100644 --- a/CRM/Contribute/Page/DashBoard.php +++ b/CRM/Contribute/Page/DashBoard.php @@ -57,7 +57,7 @@ class CRM_Contribute_Page_DashBoard extends CRM_Core_Page { foreach (array( 'now', 'yearDate', - 'monthDate' + 'monthDate', ) as $date) { $$date = $dates[$date]; } diff --git a/CRM/Core/Lock.php b/CRM/Core/Lock.php index eb42b3c207..2bde331752 100644 --- a/CRM/Core/Lock.php +++ b/CRM/Core/Lock.php @@ -148,7 +148,7 @@ class CRM_Core_Lock { * * @param string $jobLog * @throws CRM_Core_Exception - * @return boolean + * @return bool */ public function hackyHandleBrokenCode($jobLog) { if (stristr($this->_name, 'job')) { diff --git a/CRM/Event/Cart/Form/Checkout/Payment.php b/CRM/Event/Cart/Form/Checkout/Payment.php index 9933061ad8..d787a3a458 100644 --- a/CRM/Event/Cart/Form/Checkout/Payment.php +++ b/CRM/Event/Cart/Form/Checkout/Payment.php @@ -585,7 +585,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { if (is_a($result, 'CRM_Core_Error')) { CRM_Core_Error::displaySessionError($result); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/cart_checkout', "_qf_Payment_display=1&qfKey={$this->controller->_key}", TRUE, NULL, FALSE)); - return; + return NULL; } elseif (!$result['trxn_id']) { CRM_Core_Error::fatal(ts("Financial institution didn't return a transaction id.")); diff --git a/CRM/Event/Form/ManageEvent/Conference.php b/CRM/Event/Form/ManageEvent/Conference.php index a1ba39b20e..6dbe42fb18 100644 --- a/CRM/Event/Form/ManageEvent/Conference.php +++ b/CRM/Event/Form/ManageEvent/Conference.php @@ -81,7 +81,7 @@ class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent { 'slot_label_id', ts('Conference Slot'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + $slots, FALSE ); diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index f5d9d01710..60555e2828 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -139,7 +139,6 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { ) ); - $this->assign('profileTitle', $this->_title); $this->assign('componentIds', $this->_participantIds); $fileFieldExists = FALSE; @@ -350,7 +349,7 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { */ public static function updatePendingOnlineContribution($participantId, $statusId) { if (!$participantId || !$statusId) { - return; + return NULL; } $contributionId = CRM_Contribute_BAO_Contribution::checkOnlinePendingContribution($participantId, diff --git a/CRM/Friend/BAO/Friend.php b/CRM/Friend/BAO/Friend.php index f9062a3cbc..604132359f 100644 --- a/CRM/Friend/BAO/Friend.php +++ b/CRM/Friend/BAO/Friend.php @@ -91,7 +91,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { * @param array $params * (reference ) an assoc array of name/value pairs. * - * @return CRM_Contact_BAO_Contact + * @return void */ public static function create(&$params) { $transaction = new CRM_Core_Transaction(); diff --git a/CRM/Profile/Form/Search.php b/CRM/Profile/Form/Search.php index 20e36938a3..f93cdcc054 100644 --- a/CRM/Profile/Form/Search.php +++ b/CRM/Profile/Form/Search.php @@ -89,7 +89,7 @@ class CRM_Profile_Form_Search extends CRM_Profile_Form { } elseif (in_array($key, array( 'birth_date', - 'deceased_date' + 'deceased_date', ))) { list($value) = CRM_Utils_Date::setDateDefaults($value); } diff --git a/CRM/Queue/ErrorPolicy.php b/CRM/Queue/ErrorPolicy.php index d5fb08d6ea..f642ea8e66 100644 --- a/CRM/Queue/ErrorPolicy.php +++ b/CRM/Queue/ErrorPolicy.php @@ -65,7 +65,7 @@ class CRM_Queue_ErrorPolicy { foreach (array( 'display_errors', 'html_errors', - 'xmlrpc_errors' + 'xmlrpc_errors', ) as $key) { $this->backup[$key] = ini_get($key); ini_set($key, 0); @@ -84,7 +84,7 @@ class CRM_Queue_ErrorPolicy { foreach (array( 'display_errors', 'html_errors', - 'xmlrpc_errors' + 'xmlrpc_errors', ) as $key) { ini_set($key, $this->backup[$key]); } diff --git a/CRM/Report/Form/Contribute/SoftCredit.php b/CRM/Report/Form/Contribute/SoftCredit.php index e68006ace1..88c0859d42 100644 --- a/CRM/Report/Form/Contribute/SoftCredit.php +++ b/CRM/Report/Form/Contribute/SoftCredit.php @@ -419,8 +419,7 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency $count = 0; $totalAmount = $average = array(); 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; diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php index 35b597ad90..6d81879fce 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php @@ -80,7 +80,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho public static function create(&$params, $ids) { if (!is_array($params) || empty($params)) { - return; + return NULL; } if ($id = CRM_Utils_Array::value('id', $ids)) { @@ -190,7 +190,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho * @param int $fieldId * Price field id. * - * @return boolean + * @return bool * */ public static function deleteValues($fieldId) { @@ -209,7 +209,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho * @param int $id * Id. * - * @return boolean + * @return bool * */ public static function del($id) { diff --git a/CRM/Utils/Pager.php b/CRM/Utils/Pager.php index 3c9960de44..c9f40a79aa 100644 --- a/CRM/Utils/Pager.php +++ b/CRM/Utils/Pager.php @@ -126,11 +126,11 @@ class CRM_Utils_Pager extends Pager_Sliding { */ $this->_response['titleTop'] = ts('Page %1 of %2', array( 1 => '', - 2 => $this->_response['numPages'] + 2 => $this->_response['numPages'], )); $this->_response['titleBottom'] = ts('Page %1 of %2', array( 1 => '', - 2 => $this->_response['numPages'] + 2 => $this->_response['numPages'], )); } @@ -252,8 +252,6 @@ class CRM_Utils_Pager extends Pager_Sliding { /** * Use the pager class to get the pageId and Offset * - * @param void - * * @return array * an array of the pageID and offset */ diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index d233ca0cd3..2f957e4f9b 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -422,8 +422,6 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * This function does nothing in Drupal 8. Changes to the base_url should be made * in settings.php directly. * - * @param null - * * @return void */ public function mapConfigToSSL() { @@ -482,7 +480,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @return array|bool * [contactID, ufID, uniqueString] if success else false if no auth * - * This always bootstraps Drupal + * This always bootstraps Drupal */ public function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { (new CRM_Utils_System_Drupal8())->loadBootStrap(array(), FALSE); diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index f70da825a4..874d829095 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -196,7 +196,7 @@ class CRM_Utils_VersionCheck { * Get the latest version number if it's newer than the local one * * @return string|null - * Returns version number of the latest release if it is greater than the local version + * Returns version number of the latest release if it is greater than the local version */ public function isNewerVersionAvailable() { $newerVersion = NULL; @@ -309,7 +309,7 @@ class CRM_Utils_VersionCheck { * Get active payment processor types */ private function getPayProcStats() { - $dao = new CRM_Financial_DAO_PaymentProcessor; + $dao = new CRM_Financial_DAO_PaymentProcessor(); $dao->is_active = 1; $dao->find(); $ppTypes = array(); @@ -353,7 +353,7 @@ class CRM_Utils_VersionCheck { 'CRM_Pledge_DAO_PledgeBlock' => NULL, ); foreach ($tables as $daoName => $where) { - $dao = new $daoName; + $dao = new $daoName(); if ($where) { $dao->whereAdd($where); } diff --git a/api/v3/Activity.php b/api/v3/Activity.php index 0709d6ea01..c4a95986e8 100644 --- a/api/v3/Activity.php +++ b/api/v3/Activity.php @@ -222,7 +222,7 @@ function _civicrm_api3_activity_create_spec(&$params) { * * @return array * - * {@getfields activity_get} + * {@getfields activity_get} * @example ActivityGet.php Basic example * @example Activity/DateTimeHigh.php Example get with date filtering * {@example ActivityGet.php 0} diff --git a/api/v3/CustomSearch.php b/api/v3/CustomSearch.php index 2b37825c6f..2469de097f 100644 --- a/api/v3/CustomSearch.php +++ b/api/v3/CustomSearch.php @@ -12,7 +12,7 @@ * * @return array * details of found Option Values - * {@getfields OptionValue_get} + * {@getfields OptionValue_get} */ function civicrm_api3_custom_search_get($params) { require_once 'api/v3/OptionValue.php'; @@ -33,7 +33,7 @@ function civicrm_api3_custom_search_get($params) { * * @return array * Array of newly created option_value property values. - * {@getfields OptionValue_create} + * {@getfields OptionValue_create} */ function civicrm_api3_custom_search_create($params) { require_once 'api/v3/OptionValue.php'; @@ -72,7 +72,7 @@ function _civicrm_api3_custom_search_create_spec(&$params) { * * @return array * Api result - * {@getfields ReportTemplate_create} + * {@getfields ReportTemplate_create} */ function civicrm_api3_custom_search_delete($params) { require_once 'api/v3/OptionValue.php'; diff --git a/api/v3/Domain.php b/api/v3/Domain.php index da334b8f28..e06da42811 100644 --- a/api/v3/Domain.php +++ b/api/v3/Domain.php @@ -87,11 +87,11 @@ function civicrm_api3_domain_get($params) { 'phone_type_id', $values['location']['phone'][1] ) - ), - 'phone' => CRM_Utils_Array::value( + ), + 'phone' => CRM_Utils_Array::value( 'phone', $values['location']['phone'][1] - ), + ), ); } diff --git a/api/v3/Grant.php b/api/v3/Grant.php index 8a21f412ef..684940f69f 100644 --- a/api/v3/Grant.php +++ b/api/v3/Grant.php @@ -46,7 +46,7 @@ * * @return array * grant array - * {@getfields grant_create} + * {@getfields grant_create} */ function civicrm_api3_grant_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Grant'); @@ -74,7 +74,7 @@ function _civicrm_api3_grant_create_spec(&$params) { * * @return array * Array of matching grants - * {@getfields grant_get} + * {@getfields grant_get} */ function civicrm_api3_grant_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Grant'); @@ -92,7 +92,7 @@ function civicrm_api3_grant_get($params) { * * @return array * API Result Array - * {@getfields grant_delete} + * {@getfields grant_delete} */ function civicrm_api3_grant_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/LocBlock.php b/api/v3/LocBlock.php index a9af5405f2..464ad93518 100644 --- a/api/v3/LocBlock.php +++ b/api/v3/LocBlock.php @@ -44,7 +44,7 @@ * * @return array * api result array - * {@getfields loc_block_create} + * {@getfields loc_block_create} */ function civicrm_api3_loc_block_create($params) { $entities = array(); @@ -95,7 +95,7 @@ function civicrm_api3_loc_block_create($params) { * * @return array * Array of matching loc_blocks - * {@getfields loc_block_get} + * {@getfields loc_block_get} */ function civicrm_api3_loc_block_get($params) { $options = _civicrm_api3_get_options_from_params($params); @@ -133,7 +133,7 @@ function civicrm_api3_loc_block_get($params) { * * @return array * API result array - * {@getfields loc_block_delete} + * {@getfields loc_block_delete} */ function civicrm_api3_loc_block_delete($params) { return _civicrm_api3_basic_delete('CRM_Core_DAO_LocBlock', $params); diff --git a/api/v3/MailSettings.php b/api/v3/MailSettings.php index d136b8a668..235d8709cc 100644 --- a/api/v3/MailSettings.php +++ b/api/v3/MailSettings.php @@ -43,7 +43,7 @@ * * @return array * api result array - * {@getfields mail_settings_create} + * {@getfields mail_settings_create} */ function civicrm_api3_mail_settings_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -70,7 +70,7 @@ function _civicrm_api3_mail_settings_create_spec(&$params) { * * @return array * Array of matching mail_settings - * {@getfields mail_settings_get} + * {@getfields mail_settings_get} */ function civicrm_api3_mail_settings_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -88,7 +88,7 @@ function civicrm_api3_mail_settings_get($params) { * * @return array * api result array - * {@getfields mail_settings_delete} + * {@getfields mail_settings_delete} */ function civicrm_api3_mail_settings_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/MailingContact.php b/api/v3/MailingContact.php index 7bf53d370a..f58575e605 100644 --- a/api/v3/MailingContact.php +++ b/api/v3/MailingContact.php @@ -60,7 +60,7 @@ function _civicrm_api3_mailing_contact_getresults($params, $count) { //ie. because the api is an anomaly & passing in id is not valid throw new Exception('This api call does not accept api as a parameter'); } - $options = _civicrm_api3_get_options_from_params($params, TRUE,'contribution','get'); + $options = _civicrm_api3_get_options_from_params($params, TRUE, 'contribution', 'get'); $fnName = '_civicrm_api3_mailing_contact_get_' . strtolower($params['type']); return $fnName( $params['contact_id'], @@ -81,7 +81,7 @@ function _civicrm_api3_mailing_contact_get_spec(&$params) { $params['contact_id']['title'] = 'Contact ID'; $params['type'] = array( 'api.default' => 'Delivered', - 'title' => 'Type',// doesn't really explain the field - but not sure I understand it to explain it better + 'title' => 'Type', // doesn't really explain the field - but not sure I understand it to explain it better 'type' => CRM_Utils_Type::T_STRING, 'options' => array( 'Delivered' => 'Delivered', diff --git a/api/v3/MailingEventSubscribe.php b/api/v3/MailingEventSubscribe.php index 1ff9f8e14d..c90f514d75 100644 --- a/api/v3/MailingEventSubscribe.php +++ b/api/v3/MailingEventSubscribe.php @@ -46,7 +46,7 @@ * @throws API_Exception * @return array * api result array - * {@getfields mailing_event_subscribe_create} + * {@getfields mailing_event_subscribe_create} */ function civicrm_api3_mailing_event_subscribe_create($params) { $email = $params['email']; @@ -55,7 +55,7 @@ function civicrm_api3_mailing_event_subscribe_create($params) { $group = new CRM_Contact_DAO_Group(); $group->is_active = 1; - $group->id = (int)$group_id; + $group->id = (int) $group_id; if (!$group->find(TRUE)) { throw new API_Exception('Invalid Group id'); } @@ -65,7 +65,6 @@ function civicrm_api3_mailing_event_subscribe_create($params) { if ($subscribe !== NULL) { /* Ask the contact for confirmation */ - $subscribe->send_confirm_request($email); $values = array(); diff --git a/api/v3/Phone.php b/api/v3/Phone.php index 982521889d..17581d1c73 100644 --- a/api/v3/Phone.php +++ b/api/v3/Phone.php @@ -72,7 +72,7 @@ function _civicrm_api3_phone_create_spec(&$params) { * * @return array * Api Result - * {@getfields phone_delete} + * {@getfields phone_delete} * @example PhoneDelete.php */ function civicrm_api3_phone_delete($params) { diff --git a/api/v3/PriceFieldValue.php b/api/v3/PriceFieldValue.php index 5aee7f9138..ae023d38b5 100644 --- a/api/v3/PriceFieldValue.php +++ b/api/v3/PriceFieldValue.php @@ -44,7 +44,7 @@ * * @return array * api result array - * {@getfields price_field_value_create} + * {@getfields price_field_value_create} */ function civicrm_api3_price_field_value_create($params) { $ids = array(); @@ -83,7 +83,7 @@ function _civicrm_api3_price_field_value_create_spec(&$params) { * * @return array * Array of matching price_field_values - * {@getfields price_field_value_get} + * {@getfields price_field_value_get} */ function civicrm_api3_price_field_value_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -101,7 +101,7 @@ function civicrm_api3_price_field_value_get($params) { * * @return array * API result array - * {@getfields price_field_value_delete} + * {@getfields price_field_value_delete} */ function civicrm_api3_price_field_value_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/PriceSet.php b/api/v3/PriceSet.php index 082b228075..78e457d40b 100644 --- a/api/v3/PriceSet.php +++ b/api/v3/PriceSet.php @@ -44,7 +44,7 @@ * * @return array * api result array - * {@getfields price_set_create} + * {@getfields price_set_create} */ function civicrm_api3_price_set_create($params) { $result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -84,7 +84,7 @@ function _civicrm_api3_price_set_create_spec(&$params) { * * @return array * Array of matching price_sets - * {@getfields price_set_get} + * {@getfields price_set_get} */ function civicrm_api3_price_set_get($params) { // hack to make getcount work. - not sure the best approach here @@ -112,7 +112,7 @@ function civicrm_api3_price_set_get($params) { * * @return array * API result array - * {@getfields price_set_delete} + * {@getfields price_set_delete} */ function civicrm_api3_price_set_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/Survey.php b/api/v3/Survey.php index 1012f1a3b0..722476d676 100644 --- a/api/v3/Survey.php +++ b/api/v3/Survey.php @@ -44,7 +44,7 @@ * * @return array * api result array - * {@getfields survey_create} + * {@getfields survey_create} */ function civicrm_api3_survey_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Survey'); @@ -71,7 +71,7 @@ function _civicrm_api3_survey_create_spec(&$params) { * * @return array * API result Array of matching surveys - * {@getfields survey_get} + * {@getfields survey_get} */ function civicrm_api3_survey_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Survey'); @@ -89,7 +89,7 @@ function civicrm_api3_survey_get($params) { * * @return array * api result array - * {@getfields survey_delete} + * {@getfields survey_delete} */ function civicrm_api3_survey_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/Tag.php b/api/v3/Tag.php index 01f6efed53..34472fcc96 100644 --- a/api/v3/Tag.php +++ b/api/v3/Tag.php @@ -46,7 +46,7 @@ * * @return array * Array of newly created tag property values. - * {@getfields tag_create} + * {@getfields tag_create} */ function civicrm_api3_tag_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -73,7 +73,7 @@ function _civicrm_api3_tag_create_spec(&$params) { * * @return array * API result array - * {@getfields tag_delete} + * {@getfields tag_delete} */ function civicrm_api3_tag_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -92,7 +92,7 @@ function civicrm_api3_tag_delete($params) { * * @return array * details of found tags else error - * {@getfields tag_get} + * {@getfields tag_get} */ function civicrm_api3_tag_get($params) { diff --git a/api/v3/UFField.php b/api/v3/UFField.php index 7027417cdf..75daf73c28 100644 --- a/api/v3/UFField.php +++ b/api/v3/UFField.php @@ -59,7 +59,7 @@ function civicrm_api3_uf_field_create($params) { $location_type_id = CRM_Utils_Array::value('location_type_id', $params); $phone_type = CRM_Utils_Array::value('phone_type_id', $params, CRM_Utils_Array::value('phone_type', $params)); - if (! CRM_Core_BAO_UFField::isValidFieldName($field_name)) { + if (!CRM_Core_BAO_UFField::isValidFieldName($field_name)) { throw new API_Exception('The field_name is not valid'); } $params['field_name'] = array($field_type, $field_name, $location_type_id, $phone_type); @@ -110,7 +110,7 @@ function civicrm_api3_uf_field_create($params) { * * @param array $params * - * @return array + * @return void * fields valid for other functions */ function _civicrm_api3_uf_field_create_spec(&$params) { @@ -134,7 +134,7 @@ function _civicrm_api3_uf_field_create_spec(&$params) { * * @return array * (reference) Array - * {@getfields UFField_get + * {@getfields UFField_get * @example UFFieldGet.php */ function civicrm_api3_uf_field_get($params) { diff --git a/bin/deprecated/RespondentProcessor.php b/bin/deprecated/RespondentProcessor.php index 7f73f669a6..608e1e95ba 100644 --- a/bin/deprecated/RespondentProcessor.php +++ b/bin/deprecated/RespondentProcessor.php @@ -40,7 +40,7 @@ require_once 'CRM/Core/Config.php'; class CRM_RespondentProcessor { /** */ - function __construct() { + public function __construct() { $config = CRM_Core_Config::singleton(); //this does not return on failure diff --git a/tests/extensions/test.extension.manager.reporttest/main.php b/tests/extensions/test.extension.manager.reporttest/main.php index 4edf0d4acf..0c9e14731e 100644 --- a/tests/extensions/test.extension.manager.reporttest/main.php +++ b/tests/extensions/test.extension.manager.reporttest/main.php @@ -6,8 +6,8 @@ class test_extension_manager_reporttest extends CRM_Core_Report { /** */ - function __construct() { - $logging = new CRM_Logging_Schema; + public function __construct() { + $logging = new CRM_Logging_Schema(); $this->tables[] = 'civicrm_contact'; $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables())); $this->tables[] = 'civicrm_email'; @@ -25,7 +25,7 @@ class test_extension_manager_reporttest extends CRM_Core_Report { parent::__construct(); } - function buildQuickForm() { + public function buildQuickForm() { $layout = CRM_Utils_Request::retrieve('layout', 'String', $this); $this->assign('layout', $layout); diff --git a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php index a9374611ac..8de1b603da 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php @@ -89,7 +89,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { array(/* deceased[0], */ $deceased[1]->id, $deceased[2]->id, - $living[0]->id + $living[0]->id, ), $group->id ); @@ -152,7 +152,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { $this->assertCacheMatches( array(/* deceased[0], */ $deceased[1]->id, - $deceased[2]->id + $deceased[2]->id, ), $parent->id ); @@ -224,7 +224,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { * @param int $numObjects * @param bool $createOnly */ - function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) { + public function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) { $objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly); if (is_array($objects)) { $this->registerTestObjects($objects); diff --git a/tests/phpunit/CRM/Core/MenuTest.php b/tests/phpunit/CRM/Core/MenuTest.php index 7ce665f52a..a9e487cc16 100644 --- a/tests/phpunit/CRM/Core/MenuTest.php +++ b/tests/phpunit/CRM/Core/MenuTest.php @@ -17,7 +17,7 @@ class CRM_Core_MenuTest extends CiviUnitTestCase { $cases[] = array('mode=256', array('mode' => '256')); $cases[] = array( 'mode=256,addSequence=1,attachUpload=1', - array('mode' => '256', 'addSequence' => '1', 'attachUpload' => 1) + array('mode' => '256', 'addSequence' => '1', 'attachUpload' => 1), ); $cases[] = array( 'mode=256,urlToSession=a:b:c:d', @@ -26,7 +26,7 @@ class CRM_Core_MenuTest extends CiviUnitTestCase { 'urlToSession' => array( array('urlVar' => 'a', 'sessionVar' => 'b', 'type' => 'c', 'default' => 'd'), ), - ) + ), ); $cases[] = array( 'mode=256,urlToSession=a:b:c:d;z:y:x:w', @@ -36,7 +36,7 @@ class CRM_Core_MenuTest extends CiviUnitTestCase { array('urlVar' => 'a', 'sessionVar' => 'b', 'type' => 'c', 'default' => 'd'), array('urlVar' => 'z', 'sessionVar' => 'y', 'type' => 'x', 'default' => 'w'), ), - ) + ), ); $cases[] = array('url=whiz!;.:#=%/|+bang?', array('url' => 'whiz!;.:#=%/|+bang?')); return $cases; diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php index e894ad66a0..52e5be603a 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php @@ -51,7 +51,7 @@ class CRM_Core_Payment_AuthorizeNetIPNTest extends CiviUnitTestCase { $paypalIPN->main(); $contribution = $this->callAPISuccess('contribution', 'get', array( 'contribution_recur_id' => $this->_contributionRecurID, - 'sequential' => 1 + 'sequential' => 1, )); $this->assertEquals(2, $contribution['count']); $this->assertEquals('second_one', $contribution['values'][1]['trxn_id']); @@ -75,14 +75,14 @@ class CRM_Core_Payment_AuthorizeNetIPNTest extends CiviUnitTestCase { $paypalIPN->main(); $contribution = $this->callAPISuccess('contribution', 'get', array( 'contribution_recur_id' => $this->_contributionRecurID, - 'sequential' => 1 + 'sequential' => 1, )); $this->assertEquals(2, $contribution['count']); $this->assertEquals('second_one', $contribution['values'][1]['trxn_id']); $this->callAPISuccessGetSingle('membership_payment', array('contribution_id' => $contribution['values'][1]['id'])); $this->callAPISuccessGetSingle('line_item', array( 'contribution_id' => $contribution['values'][1]['id'], - 'entity_table' => 'civicrm_membership' + 'entity_table' => 'civicrm_membership', )); } diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index e0327a41fd..eee1c4306a 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -70,7 +70,7 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'value' => 'foo', 'is_active' => 1, 'weight' => 0, - ) + ), ), ); $result = civicrm_api3('custom_field', 'create', $api_params); @@ -1083,14 +1083,14 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { // But we can also fetch by ID $result = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'contact_type', array( 'keyColumn' => 'id', - 'labelColumn' => 'name' + 'labelColumn' => 'name', )); $this->assertEquals($byId, $result); // Make sure flip param works $result = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'contact_type', array( 'keyColumn' => 'id', 'labelColumn' => 'name', - 'flip' => TRUE + 'flip' => TRUE, )); $this->assertEquals(array_flip($byId), $result); } diff --git a/tests/phpunit/CRM/Queue/QueueTest.php b/tests/phpunit/CRM/Queue/QueueTest.php index 24c4902131..50d8d4b2a5 100644 --- a/tests/phpunit/CRM/Queue/QueueTest.php +++ b/tests/phpunit/CRM/Queue/QueueTest.php @@ -46,18 +46,20 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { array( 'type' => 'Sql', 'name' => 'test-queue', - ) + ), ); $queueSpecs[] = array( array( 'type' => 'Memory', '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/CRM/Utils/API/MatchOptionTest.php b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php index a6c2e9a802..ea9e52578f 100644 --- a/tests/phpunit/CRM/Utils/API/MatchOptionTest.php +++ b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php @@ -189,7 +189,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { array( 'location_type_id' => 2, 'email' => 'j2@example.com', - 'signature_text' => 'You know, a lotta ins, a lotta outs, a lotta what-have-yous.' + 'signature_text' => 'You know, a lotta ins, a lotta outs, a lotta what-have-yous.', ), ), ), @@ -269,12 +269,12 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { array( 'location_type_id' => 1, 'street_address' => 'j1-a Example Ave', - 'supplemental_address_1' => 'The Dude abides.' + 'supplemental_address_1' => 'The Dude abides.', ), array( 'location_type_id' => 2, 'street_address' => 'j2 Example Ave', - 'supplemental_address_1' => 'You know, a lotta ins, a lotta outs, a lotta what-have-yous.' + 'supplemental_address_1' => 'You know, a lotta ins, a lotta outs, a lotta what-have-yous.', ), ), ), diff --git a/tests/phpunit/CRM/Utils/Cache/AllTests.php b/tests/phpunit/CRM/Utils/Cache/AllTests.php index 03108aed0e..2fba80953a 100644 --- a/tests/phpunit/CRM/Utils/Cache/AllTests.php +++ b/tests/phpunit/CRM/Utils/Cache/AllTests.php @@ -47,7 +47,7 @@ class CRM_Utils_Cache_AllTests extends CiviTestSuite { */ private static function getInstance() { if (is_null(self::$instance)) { - self::$instance = new self; + self::$instance = new self(); } return self::$instance; } diff --git a/tests/phpunit/CiviTest/Custom.php b/tests/phpunit/CiviTest/Custom.php index 699efaa876..8e85ce5660 100644 --- a/tests/phpunit/CiviTest/Custom.php +++ b/tests/phpunit/CiviTest/Custom.php @@ -101,7 +101,6 @@ class Custom extends CiviUnitTestCase { /** * Helper function to delete custom field * @deprecated use function on parent class - * @param object of Custom Field to delete */ public static function deleteField($params) { require_once 'CRM/Core/BAO/CustomField.php'; @@ -111,8 +110,7 @@ class Custom extends CiviUnitTestCase { /** * Helper function to delete custom group * @deprecated use function on parent class - * @param object Custom Group to delete - * @return boolean + * @return bool * true if Group deleted, false otherwise */ public static function deleteGroup($params) { diff --git a/tests/phpunit/CiviTest/Event.php b/tests/phpunit/CiviTest/Event.php index bd393f36c5..b243622c32 100644 --- a/tests/phpunit/CiviTest/Event.php +++ b/tests/phpunit/CiviTest/Event.php @@ -37,7 +37,7 @@ class Event extends PHPUnit_Framework_Testcase { * Helper function to delete an Event * * @param int $eventId - * @return boolean + * @return bool * true if event deleted, false otherwise */ public static function delete($eventId) { diff --git a/tests/phpunit/CiviTest/PaypalPro.php b/tests/phpunit/CiviTest/PaypalPro.php index 1a9ce0a411..c01369f90e 100644 --- a/tests/phpunit/CiviTest/PaypalPro.php +++ b/tests/phpunit/CiviTest/PaypalPro.php @@ -11,8 +11,8 @@ class PaypalPro extends PHPUnit_Framework_Testcase { * * @return int * $paymentProcessor id of created payment processor@todo this appears not to be working but because it doesn't extend the test class - * callAPISuccess won't work - * I have duplicated this on the main test class as a work around + * callAPISuccess won't work + * I have duplicated this on the main test class as a work around */ public static function create() { @@ -45,7 +45,7 @@ class PaypalPro extends PHPUnit_Framework_Testcase { * @param int $id * Id of the PayPal Pro payment processor. * to be deleted - * @return boolean + * @return bool * true if payment processor deleted, false otherwise */ public static function delete($id) { diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index b592be535d..543d11418a 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -763,8 +763,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $participantEmails = array($primaryParticipant, $secParticipant, $thirdParticipant); $addtlPart = array($secParticipant, $thirdParticipant); - $primaryParticipantInfo = - $this->_testOnlineRegistration($registerUrl, 2, $anonymous, FALSE, $participantEmails, "Test Processor"); + $primaryParticipantInfo = $this->_testOnlineRegistration($registerUrl, 2, $anonymous, FALSE, $participantEmails, "Test Processor"); $primaryDisplayName = "{$primaryParticipantInfo['first_name']} {$primaryParticipantInfo['last_name']}"; $this->webtestLogin(); $this->openCiviPage("event/search", "reset=1"); diff --git a/tests/phpunit/WebTest/Import/ContactSubtypeTest.php b/tests/phpunit/WebTest/Import/ContactSubtypeTest.php index 18ed1c3b4b..3c1d05edee 100644 --- a/tests/phpunit/WebTest/Import/ContactSubtypeTest.php +++ b/tests/phpunit/WebTest/Import/ContactSubtypeTest.php @@ -35,7 +35,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { parent::setUp(); } - /* + /** * Test contact import for Individuals Subtype. */ public function testIndividualSubtypeImport() { @@ -117,7 +117,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { $this->importContacts($headers, $rows, 'Individual', 'No Duplicate Checking', array(), $other); } - /* + /** * Test contact import for Organization Subtype. */ public function testOrganizationSubtypeImport() { @@ -193,7 +193,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { $this->importContacts($headers, $rows, 'Organization', 'No Duplicate Checking', array(), $other); } - /* + /** * Test contact import for Household Subtype. */ public function testHouseholdSubtypeImport() { diff --git a/tests/phpunit/WebTest/Import/ContactTest.php b/tests/phpunit/WebTest/Import/ContactTest.php index d105e06971..e012887a55 100644 --- a/tests/phpunit/WebTest/Import/ContactTest.php +++ b/tests/phpunit/WebTest/Import/ContactTest.php @@ -35,7 +35,7 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { parent::setUp(); } - /* + /** * Test contact import for Individuals. */ public function testIndividualImport() { @@ -122,7 +122,7 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { $this->importContacts($headers, $rows, 'Individual', 'No Duplicate Checking'); } - /* + /** * Test contact import for Organization. */ public function testOrganizationImport() { @@ -203,7 +203,7 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { $this->importContacts($headers, $rows, 'Organization', 'No Duplicate Checking'); } - /* + /** * Test contact import for Household. */ public function testHouseholdImport() { diff --git a/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php b/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php index 5a5e213bdc..6e3923fb09 100644 --- a/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php +++ b/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php @@ -35,7 +35,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { parent::setUp(); } - /* + /** * Test contact import for Individuals Duplicate Matching. */ public function testIndividualDuplicateMatchingImport() { @@ -136,7 +136,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { $this->importContacts($headers, $rows, 'Individual', 'No Duplicate Checking'); } - /* + /** * Test contact import for Organization Duplicate Matching. */ public function testOrganizationDuplicateMatchingImport() { @@ -231,7 +231,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { $this->importContacts($headers, $rows, 'Organization', 'No Duplicate Checking'); } - /* + /** * Test contact import for Household Duplicate Matching. */ public function testHouseholdDuplicateMatchingImport() { diff --git a/tests/phpunit/api/v3/EntityTagTest.php b/tests/phpunit/api/v3/EntityTagTest.php index a6938f3432..f2f99ce4c1 100644 --- a/tests/phpunit/api/v3/EntityTagTest.php +++ b/tests/phpunit/api/v3/EntityTagTest.php @@ -119,7 +119,9 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->assertEquals($result['not_added'], 1); } - ///////////////// civicrm_entity_tag_get methods + /** + * civicrm_entity_tag_get methods + */ public function testGetNoEntityID() { $ContactId = $this->_individualID; $tagID = $this->_tagID; @@ -178,7 +180,9 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $entity = $this->callAPISuccess('entity_tag', 'get', $paramsEntity); } - ///////////////// civicrm_entity_tag_Delete methods + /** + * civicrm_entity_tag_Delete methods + */ public function testEntityTagDeleteNoTagId() { $entityTagParams = array( 'contact_id_i' => $this->_individualID, @@ -252,8 +256,9 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->assertEquals($result['not_removed'], 1); } - ///////////////// civicrm_tag_entities_get methods - + /** + * civicrm_tag_entities_get methods + */ public function testCommonContactEntityTagAdd() { $params = array( 'contact_id' => $this->_individualID, diff --git a/tests/phpunit/api/v3/MembershipTest.php b/tests/phpunit/api/v3/MembershipTest.php index 0a1089266f..595d0769ab 100644 --- a/tests/phpunit/api/v3/MembershipTest.php +++ b/tests/phpunit/api/v3/MembershipTest.php @@ -626,9 +626,9 @@ class api_v3_MembershipTest extends CiviUnitTestCase { $this->assertEquals($result['id'], $result['values'][$result['id']]['id'], " in line " . __LINE__); } - /* - * Check for useful message if contact doesn't exist - */ + /** + * Check for useful message if contact doesn't exist + */ public function testMembershipCreateWithInvalidContact() { $params = array( 'contact_id' => 999, @@ -833,7 +833,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /** * per CRM-15746 check that the id can be altered in an update hook */ - function testMembershipUpdateCreateHookCRM15746() { + public function testMembershipUpdateCreateHookCRM15746() { $this->hookClass->setHook('civicrm_pre', array($this, 'hook_civicrm_pre_update_create_membership')); $result = $this->callAPISuccess('membership', 'create', $this->_params); $this->callAPISuccess('membership', 'create', array('id' => $result['id'], 'end_date' => '1 year ago')); @@ -843,7 +843,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { $this->callAPISuccessGetCount('membership', array(), 2); } - function hook_civicrm_pre_update_create_membership($op, $objectName, $id, &$params) { + public function hook_civicrm_pre_update_create_membership($op, $objectName, $id, &$params) { if ($objectName == 'Membership' && $op == 'edit') { $existingMembership = $this->callAPISuccessGetSingle('membership', array('id' => $params['id'])); unset($params['id'], $params['membership_id']); -- 2.25.1