From 5d4fcf5450aed1c1b8b3fef49efdb56a75dec7c9 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 5 Apr 2019 14:27:21 -0700 Subject: [PATCH] (NFC) Apply upcoming civicrm/coder policies (batch 2) Method: * Checkout latest merged branch of civicrm/coder (`8.x-2.x-civi`) * Run this command to autoclean a batch of 100 files `PG=2 SIZE=100 ; find Civi/ CRM/ api/ bin/ extern/ tests/ -name '*.php' | grep -v /examples/ | grep -v /DAO/ | sort | head -n $(( $PG * $SIZE )) | tail -n $SIZE | xargs phpcbf-civi` * Go through the diff. For anything that looks wonky, open in an editor and find a better solution. Note: The automated checker makes good points about awkward indentation, but the automated cleanup often makes it worse. So that's why I have to open it up. --- CRM/Admin/Page/CKEditorConfig.php | 10 +++-- CRM/Admin/Page/Extensions.php | 3 +- CRM/Admin/Page/ExtensionsUpgrade.php | 3 +- CRM/Admin/Page/MessageTemplates.php | 3 +- CRM/Admin/Page/PaymentProcessor.php | 6 +-- CRM/Badge/Form/Layout.php | 29 +++++++------ CRM/Batch/Form/Entry.php | 30 +++++++------- CRM/Campaign/BAO/Campaign.php | 3 +- CRM/Campaign/BAO/Query.php | 5 +-- CRM/Campaign/BAO/Survey.php | 9 ++-- CRM/Campaign/Form/Campaign.php | 21 +++++----- CRM/Campaign/Form/Petition/Signature.php | 13 +++--- CRM/Campaign/Form/Search.php | 6 +-- CRM/Campaign/Form/Search/Campaign.php | 3 +- CRM/Campaign/Form/Survey/Delete.php | 21 +++++----- CRM/Campaign/Form/Survey/Questions.php | 3 +- CRM/Campaign/Form/Survey/Results.php | 3 +- CRM/Campaign/Form/Task.php | 21 +++++----- CRM/Campaign/Form/Task/Interview.php | 22 +++++----- CRM/Campaign/Form/Task/Print.php | 23 +++++------ CRM/Campaign/Form/Task/Release.php | 12 +++--- CRM/Campaign/Form/Task/Result.php | 13 +++--- CRM/Campaign/Page/AJAX.php | 44 ++++++++++---------- CRM/Campaign/Page/Vote.php | 3 +- CRM/Case/BAO/Case.php | 3 +- CRM/Case/BAO/CaseType.php | 3 +- CRM/Case/Form/Activity/ChangeCaseStatus.php | 7 ++-- CRM/Case/Form/Activity/OpenCase.php | 44 ++++++++++---------- CRM/Case/Form/Case.php | 46 ++++++++++----------- CRM/Case/Form/CaseView.php | 21 +++++----- CRM/Case/Form/CustomData.php | 21 +++++----- 31 files changed, 219 insertions(+), 235 deletions(-) diff --git a/CRM/Admin/Page/CKEditorConfig.php b/CRM/Admin/Page/CKEditorConfig.php index ac157b423e..03f7ec34b0 100644 --- a/CRM/Admin/Page/CKEditorConfig.php +++ b/CRM/Admin/Page/CKEditorConfig.php @@ -106,10 +106,12 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page { $this->assign('configUrl', $configUrl); $this->assign('revertConfirm', htmlspecialchars(ts('Are you sure you want to revert all changes?', ['escape' => 'js']))); - CRM_Utils_System::appendBreadCrumb([[ - 'url' => CRM_Utils_System::url('civicrm/admin/setting/preferences/display', 'reset=1'), - 'title' => ts('Display Preferences'), - ]]); + CRM_Utils_System::appendBreadCrumb([ + [ + 'url' => CRM_Utils_System::url('civicrm/admin/setting/preferences/display', 'reset=1'), + 'title' => ts('Display Preferences'), + ], + ]); return parent::run(); } diff --git a/CRM/Admin/Page/Extensions.php b/CRM/Admin/Page/Extensions.php index 9250536e5d..d242c9090b 100644 --- a/CRM/Admin/Page/Extensions.php +++ b/CRM/Admin/Page/Extensions.php @@ -160,7 +160,8 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { $mapper = CRM_Extension_System::singleton()->getMapper(); $manager = CRM_Extension_System::singleton()->getManager(); - $localExtensionRows = []; // array($pseudo_id => extended_CRM_Extension_Info) + // array($pseudo_id => extended_CRM_Extension_Info) + $localExtensionRows = []; $keys = array_keys($manager->getStatuses()); sort($keys); foreach ($keys as $key) { diff --git a/CRM/Admin/Page/ExtensionsUpgrade.php b/CRM/Admin/Page/ExtensionsUpgrade.php index fceb66ebb3..3a183826fc 100644 --- a/CRM/Admin/Page/ExtensionsUpgrade.php +++ b/CRM/Admin/Page/ExtensionsUpgrade.php @@ -24,7 +24,8 @@ class CRM_Admin_Page_ExtensionsUpgrade extends CRM_Core_Page { ]); CRM_Core_Error::debug_log_message('CRM_Admin_Page_ExtensionsUpgrade: Start upgrades'); - $runner->runAllViaWeb(); // does not return + // does not return + $runner->runAllViaWeb(); } /** diff --git a/CRM/Admin/Page/MessageTemplates.php b/CRM/Admin/Page/MessageTemplates.php index ab21c4da17..86efc76239 100644 --- a/CRM/Admin/Page/MessageTemplates.php +++ b/CRM/Admin/Page/MessageTemplates.php @@ -161,7 +161,8 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { } // rebuild the action links HTML, as we need to handle %%orig_id%% for revertible templates - $values['action'] = CRM_Core_Action::formLink($links, $action, [ + $values['action'] = CRM_Core_Action::formLink($links, $action, + [ 'id' => $object->id, 'orig_id' => CRM_Utils_Array::value($object->id, $this->_revertible), ], diff --git a/CRM/Admin/Page/PaymentProcessor.php b/CRM/Admin/Page/PaymentProcessor.php index b79a3d4eed..4a5142e88a 100644 --- a/CRM/Admin/Page/PaymentProcessor.php +++ b/CRM/Admin/Page/PaymentProcessor.php @@ -101,9 +101,9 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { CRM_Utils_System::setTitle(ts('Settings - Payment Processor')); //CRM-15546 $paymentProcessorTypes = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_PaymentProcessor', 'payment_processor_type_id', array( - 'labelColumn' => 'name', - 'flip' => 1, - )); + 'labelColumn' => 'name', + 'flip' => 1, + )); $this->assign('defaultPaymentProcessorType', $paymentProcessorTypes['PayPal']); $breadCrumb = array( array( diff --git a/CRM/Badge/Form/Layout.php b/CRM/Badge/Form/Layout.php index a34b5ebcc4..af93d47ee0 100644 --- a/CRM/Badge/Form/Layout.php +++ b/CRM/Badge/Form/Layout.php @@ -131,21 +131,20 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { $this->addRule('width_participant_image', ts('Enter valid height'), 'positiveInteger'); $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'refresh', - 'name' => ts('Save and Preview'), - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'refresh', + 'name' => ts('Save and Preview'), + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index ab4475da81..ec698a8d1d 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -177,17 +177,16 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { ); $this->addButtons([ - [ - 'type' => 'upload', - 'name' => ts('Validate & Process the Batch'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Save & Continue Later'), - ], - ] - ); + [ + 'type' => 'upload', + 'name' => ts('Validate & Process the Batch'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Save & Continue Later'), + ], + ]); $this->assign('rowCount', $this->_batchInfo['item_count'] + 1); @@ -204,9 +203,9 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { for ($rowNumber = 1; $rowNumber <= $this->_batchInfo['item_count']; $rowNumber++) { $this->addEntityRef("primary_contact_id[{$rowNumber}]", '', [ - 'create' => TRUE, - 'placeholder' => ts('- select -'), - ]); + 'create' => TRUE, + 'placeholder' => ts('- select -'), + ]); // special field specific to membership batch udpate if ($this->_batchInfo['type_id'] == 2) { @@ -254,7 +253,8 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { // Notes: $this->_elementIndex gives an approximate count of the variables being sent // An offset value is set to deal with additional vars that are likely passed. // There may be a more accurate way to do this... - $offset = 50; // set an offset to account for other vars we are not counting + // set an offset to account for other vars we are not counting + $offset = 50; if ((count($this->_elementIndex) + $offset) > ini_get("max_input_vars")) { CRM_Core_Error::fatal(ts('Batch size is too large. Increase value of php.ini setting "max_input_vars" (current val = ' . ini_get("max_input_vars") . ')')); } diff --git a/CRM/Campaign/BAO/Campaign.php b/CRM/Campaign/BAO/Campaign.php index 23c75b5c79..0d5ebe8cb5 100644 --- a/CRM/Campaign/BAO/Campaign.php +++ b/CRM/Campaign/BAO/Campaign.php @@ -716,7 +716,8 @@ INNER JOIN civicrm_group grp ON ( grp.id = campgrp.entity_id ) 'url' => CRM_Utils_System::url('civicrm/campaign/add', "reset=1", NULL, NULL, FALSE, FALSE, TRUE), 'type' => 'Campaign', - ]]; + ], + ]; } return FALSE; } diff --git a/CRM/Campaign/BAO/Query.php b/CRM/Campaign/BAO/Query.php index 4f2f0e09a7..86391e8348 100644 --- a/CRM/Campaign/BAO/Query.php +++ b/CRM/Campaign/BAO/Query.php @@ -398,10 +398,7 @@ INNER JOIN civicrm_custom_group grp on fld.custom_group_id = grp.id $dao = CRM_Core_DAO::executeQuery($query, [1 => ['Voter_Info', 'String']]); $customSearchFields = []; while ($dao->fetch()) { - foreach ([ - 'ward', - 'precinct', - ] as $name) { + foreach (['ward', 'precinct'] as $name) { if (stripos($name, $dao->label) !== FALSE) { $fieldId = $dao->id; $fieldName = 'custom_' . $dao->id; diff --git a/CRM/Campaign/BAO/Survey.php b/CRM/Campaign/BAO/Survey.php index 7ec3ca0e4a..63c9244890 100644 --- a/CRM/Campaign/BAO/Survey.php +++ b/CRM/Campaign/BAO/Survey.php @@ -439,11 +439,8 @@ SELECT survey.id as id, $autocompleteContactSearch = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_autocomplete_options' ); - $returnProperties = array_fill_keys(array_merge([ - 'contact_type', - 'contact_sub_type', - 'sort_name', - ], + $returnProperties = array_fill_keys(array_merge( + ['contact_type', 'contact_sub_type', 'sort_name'], array_keys($autocompleteContactSearch) ), 1); } @@ -913,7 +910,7 @@ INNER JOIN civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a * * @return mixed */ - public Static function getReportID($surveyId) { + public static function getReportID($surveyId) { static $reportIds = []; if (!array_key_exists($surveyId, $reportIds)) { diff --git a/CRM/Campaign/Form/Campaign.php b/CRM/Campaign/Form/Campaign.php index 91536ec81d..06a3c6130b 100644 --- a/CRM/Campaign/Form/Campaign.php +++ b/CRM/Campaign/Form/Campaign.php @@ -168,17 +168,16 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form { if ($this->_action & CRM_Core_Action::DELETE) { $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Delete'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); return; } diff --git a/CRM/Campaign/Form/Petition/Signature.php b/CRM/Campaign/Form/Petition/Signature.php index c973bfdc55..f39166cebf 100644 --- a/CRM/Campaign/Form/Petition/Signature.php +++ b/CRM/Campaign/Form/Petition/Signature.php @@ -297,13 +297,12 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form { } // add buttons $this->addButtons([ - [ - 'type' => 'upload', - 'name' => ts('Sign the Petition'), - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'upload', + 'name' => ts('Sign the Petition'), + 'isDefault' => TRUE, + ], + ]); } /** diff --git a/CRM/Campaign/Form/Search.php b/CRM/Campaign/Form/Search.php index 02c54b871d..43b0c707ba 100644 --- a/CRM/Campaign/Form/Search.php +++ b/CRM/Campaign/Form/Search.php @@ -339,11 +339,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { //apply filter of survey contact type for search. $contactType = CRM_Campaign_BAO_Survey::getSurveyContactType(CRM_Utils_Array::value('campaign_survey_id', $this->_formValues)); - if ($contactType && in_array($this->_operation, array( - 'reserve', - 'interview', - )) - ) { + if ($contactType && in_array($this->_operation, ['reserve', 'interview'])) { $this->_formValues['contact_type'][$contactType] = 1; } diff --git a/CRM/Campaign/Form/Search/Campaign.php b/CRM/Campaign/Form/Search/Campaign.php index 331cadd605..6fc5d63ab8 100644 --- a/CRM/Campaign/Form/Search/Campaign.php +++ b/CRM/Campaign/Form/Search/Campaign.php @@ -110,8 +110,7 @@ class CRM_Campaign_Form_Search_Campaign extends CRM_Core_Form { '' => ts('- select -'), '0' => ts('Yes'), '1' => ts('No'), - ] - ); + ]); //build the array of all search params. $this->_searchParams = []; diff --git a/CRM/Campaign/Form/Survey/Delete.php b/CRM/Campaign/Form/Survey/Delete.php index 8d32335eb8..2f473c9632 100644 --- a/CRM/Campaign/Form/Survey/Delete.php +++ b/CRM/Campaign/Form/Survey/Delete.php @@ -72,17 +72,16 @@ class CRM_Campaign_Form_Survey_Delete extends CRM_Core_Form { */ public function buildQuickForm() { $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Delete'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** diff --git a/CRM/Campaign/Form/Survey/Questions.php b/CRM/Campaign/Form/Survey/Questions.php index b0cfd2ddba..c7154ceb37 100644 --- a/CRM/Campaign/Form/Survey/Questions.php +++ b/CRM/Campaign/Form/Survey/Questions.php @@ -66,7 +66,8 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey { public function buildQuickForm() { $subTypeId = CRM_Core_DAO::getFieldValue('CRM_Campaign_DAO_Survey', $this->_surveyId, 'activity_type_id'); if (!CRM_Core_BAO_CustomGroup::autoCreateByActivityType($subTypeId)) { - $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE, FALSE); // everything + // everything + $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE, FALSE); // FIXME: Displays weird "/\ Array" message; doesn't work with tabs CRM_Core_Session::setStatus( ts( diff --git a/CRM/Campaign/Form/Survey/Results.php b/CRM/Campaign/Form/Survey/Results.php index 5c2946ac8e..20475c05aa 100644 --- a/CRM/Campaign/Form/Survey/Results.php +++ b/CRM/Campaign/Form/Survey/Results.php @@ -413,7 +413,8 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey { 'name' => "survey_{$survey->id}", 'title' => $params['report_title'] ? $params['report_title'] : $this->_values['title'], 'status_id_op' => 'eq', - 'status_id_value' => $activityStatus['Scheduled'], // reserved status + // reserved status + 'status_id_value' => $activityStatus['Scheduled'], 'survey_id_value' => [$survey->id], 'description' => ts('Detailed report for canvassing, phone-banking, walk lists or other surveys.'), ]; diff --git a/CRM/Campaign/Form/Task.php b/CRM/Campaign/Form/Task.php index 86b7a269b9..f6575049df 100644 --- a/CRM/Campaign/Form/Task.php +++ b/CRM/Campaign/Form/Task.php @@ -109,17 +109,16 @@ class CRM_Campaign_Form_Task extends CRM_Core_Form_Task { */ public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons([ - [ - 'type' => $nextType, - 'name' => $title, - 'isDefault' => TRUE, - ], - [ - 'type' => $backType, - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => $nextType, + 'name' => $title, + 'isDefault' => TRUE, + ], + [ + 'type' => $backType, + 'name' => ts('Cancel'), + ], + ]); } } diff --git a/CRM/Campaign/Form/Task/Interview.php b/CRM/Campaign/Form/Task/Interview.php index 30bc84499d..1bffb99f9a 100644 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -75,10 +75,10 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task { if ($this->_reserveToInterview || $this->_votingTab) { //user came from voting tab / reserve form. foreach ([ - 'surveyId', - 'contactIds', - 'interviewerId', - ] as $fld) { + 'surveyId', + 'contactIds', + 'interviewerId', + ] as $fld) { $this->{"_$fld"} = $this->get($fld); } //get the target voter ids. @@ -292,9 +292,9 @@ WHERE {$clause} for ($i = 1; $i < count($options); $i++) { $this->addElement('select', "order_bys[{$i}][column]", ts('Order by Column'), $options); $this->addElement('select', "order_bys[{$i}][order]", ts('Order by Order'), [ - 'ASC' => ts('Ascending'), - 'DESC' => ts('Descending'), - ]); + 'ASC' => ts('Ascending'), + 'DESC' => ts('Descending'), + ]); } //pickup the uf fields. @@ -443,10 +443,10 @@ WHERE {$clause} elseif ($buttonName == '_qf_Interview_next_interviewToRelease') { //get ready to jump to release form. foreach ([ - 'surveyId', - 'contactIds', - 'interviewerId', - ] as $fld) { + 'surveyId', + 'contactIds', + 'interviewerId', + ] as $fld) { $this->controller->set($fld, $this->{"_$fld"}); } $this->controller->set('interviewToRelease', TRUE); diff --git a/CRM/Campaign/Form/Task/Print.php b/CRM/Campaign/Form/Task/Print.php index e6fea042b5..bfc08a1100 100644 --- a/CRM/Campaign/Form/Task/Print.php +++ b/CRM/Campaign/Form/Task/Print.php @@ -82,18 +82,17 @@ class CRM_Campaign_Form_Task_Print extends CRM_Campaign_Form_Task { // just need to add a javacript to popup the window for printing // $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Print Respondents'), - 'js' => ['onclick' => 'window.print()'], - 'isDefault' => TRUE, - ], - [ - 'type' => 'back', - 'name' => ts('Done'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Print Respondents'), + 'js' => ['onclick' => 'window.print()'], + 'isDefault' => TRUE, + ], + [ + 'type' => 'back', + 'name' => ts('Done'), + ], + ]); } /** diff --git a/CRM/Campaign/Form/Task/Release.php b/CRM/Campaign/Form/Task/Release.php index c45a8d5369..75d994d155 100644 --- a/CRM/Campaign/Form/Task/Release.php +++ b/CRM/Campaign/Form/Task/Release.php @@ -67,10 +67,10 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task { if ($this->_interviewToRelease) { //user came from interview form. foreach ([ - 'surveyId', - 'contactIds', - 'interviewerId', - ] as $fld) { + 'surveyId', + 'contactIds', + 'interviewerId', + ] as $fld) { $this->{"_$fld"} = $this->get($fld); } @@ -101,9 +101,7 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task { $activityStatus = CRM_Core_PseudoConstant::activityStatus('name'); $statusIds = []; - foreach ([ - 'Scheduled', - ] as $name) { + foreach (['Scheduled'] as $name) { if ($statusId = array_search($name, $activityStatus)) { $statusIds[] = $statusId; } diff --git a/CRM/Campaign/Form/Task/Result.php b/CRM/Campaign/Form/Task/Result.php index 88185e5859..25f81fb7fd 100644 --- a/CRM/Campaign/Form/Task/Result.php +++ b/CRM/Campaign/Form/Task/Result.php @@ -47,13 +47,12 @@ class CRM_Campaign_Form_Task_Result extends CRM_Campaign_Form_Task { */ public function buildQuickForm() { $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'done', + 'name' => ts('Done'), + 'isDefault' => TRUE, + ], + ]); } } diff --git a/CRM/Campaign/Page/AJAX.php b/CRM/Campaign/Page/AJAX.php index a784ef99af..ecec019936 100644 --- a/CRM/Campaign/Page/AJAX.php +++ b/CRM/Campaign/Page/AJAX.php @@ -158,9 +158,9 @@ class CRM_Campaign_Page_AJAX { //format multi-select group and contact types. foreach ([ - 'group', - 'contact_type', - ] as $param) { + 'group', + 'contact_type', + ] as $param) { $paramValue = CRM_Utils_Array::value($param, $params); if ($paramValue) { unset($params[$param]); @@ -173,10 +173,10 @@ class CRM_Campaign_Page_AJAX { $voterClauseParams = []; foreach ([ - 'campaign_survey_id', - 'survey_interviewer_id', - 'campaign_search_voter_for', - ] as $fld) { + 'campaign_survey_id', + 'survey_interviewer_id', + 'campaign_search_voter_for', + ] as $fld) { $voterClauseParams[$fld] = CRM_Utils_Array::value($fld, $params); } @@ -602,11 +602,11 @@ class CRM_Campaign_Page_AJAX { } } foreach ([ - 'sort', - 'offset', - 'rowCount', - 'sortOrder', - ] as $sortParam) { + 'sort', + 'offset', + 'rowCount', + 'sortOrder', + ] as $sortParam) { $params[$sortParam] = $$sortParam; } @@ -707,11 +707,11 @@ class CRM_Campaign_Page_AJAX { } } foreach ([ - 'sort', - 'offset', - 'rowCount', - 'sortOrder', - ] as $sortParam) { + 'sort', + 'offset', + 'rowCount', + 'sortOrder', + ] as $sortParam) { $params[$sortParam] = $$sortParam; } @@ -807,11 +807,11 @@ class CRM_Campaign_Page_AJAX { } } foreach ([ - 'sort', - 'offset', - 'rowCount', - 'sortOrder', - ] as $sortParam) { + 'sort', + 'offset', + 'rowCount', + 'sortOrder', + ] as $sortParam) { $params[$sortParam] = $$sortParam; } diff --git a/CRM/Campaign/Page/Vote.php b/CRM/Campaign/Page/Vote.php index 4bb67d1cc4..ad131746ff 100644 --- a/CRM/Campaign/Page/Vote.php +++ b/CRM/Campaign/Page/Vote.php @@ -119,8 +119,7 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page { 'administer CiviCampaign', "{$name} campaign contacts", ], - ]) - ) { + ])) { continue; } diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 09e2cb6fe0..db2d1ca90c 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -76,7 +76,8 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { $caseDAO = new CRM_Case_DAO_Case(); $caseDAO->copyValues($params); $result = $caseDAO->save(); - $caseDAO->find(TRUE); // Get other case values (required by XML processor), this adds to $result array + // Get other case values (required by XML processor), this adds to $result array + $caseDAO->find(TRUE); return $result; } diff --git a/CRM/Case/BAO/CaseType.php b/CRM/Case/BAO/CaseType.php index b89f35abf3..d798576114 100644 --- a/CRM/Case/BAO/CaseType.php +++ b/CRM/Case/BAO/CaseType.php @@ -160,7 +160,8 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { } break; - case 'sequence': // passthrough + // passthrough + case 'sequence': case 'timeline': if ($setVal) { $xmlFile .= "<{$index}>true\n"; diff --git a/CRM/Case/Form/Activity/ChangeCaseStatus.php b/CRM/Case/Form/Activity/ChangeCaseStatus.php index a5503aac1e..d0059b0cf2 100644 --- a/CRM/Case/Form/Activity/ChangeCaseStatus.php +++ b/CRM/Case/Form/Activity/ChangeCaseStatus.php @@ -208,10 +208,9 @@ class CRM_Case_Form_Activity_ChangeCaseStatus { foreach ($form->_oldCaseStatus as $statuskey => $statusval) { if ($activity->subject == 'null') { $activity->subject = ts('Case status changed from %1 to %2', [ - 1 => CRM_Utils_Array::value($statusval, $form->_caseStatus), - 2 => CRM_Utils_Array::value($params['case_status_id'], $form->_caseStatus), - ] - ); + 1 => CRM_Utils_Array::value($statusval, $form->_caseStatus), + 2 => CRM_Utils_Array::value($params['case_status_id'], $form->_caseStatus), + ]); $activity->save(); } } diff --git a/CRM/Case/Form/Activity/OpenCase.php b/CRM/Case/Form/Activity/OpenCase.php index 1903cc87d4..37f794492e 100644 --- a/CRM/Case/Form/Activity/OpenCase.php +++ b/CRM/Case/Form/Activity/OpenCase.php @@ -107,7 +107,8 @@ class CRM_Case_Form_Activity_OpenCase { else { $caseStatus = CRM_Core_OptionGroup::values('case_status', FALSE, FALSE, FALSE, 'AND is_default = 1'); if (count($caseStatus) == 1) { - $caseStatus = key($caseStatus); //$defaults['status_id'] = key($caseStatus); + //$defaults['status_id'] = key($caseStatus); + $caseStatus = key($caseStatus); } } $defaults['status_id'] = $caseStatus; @@ -153,9 +154,9 @@ class CRM_Case_Form_Activity_OpenCase { } if ($form->_context == 'standalone') { $form->addEntityRef('client_id', ts('Client'), [ - 'create' => TRUE, - 'multiple' => $form->_allowMultiClient, - ], TRUE); + 'create' => TRUE, + 'multiple' => $form->_allowMultiClient, + ], TRUE); } $element = $form->addField('case_type_id', [ @@ -193,24 +194,23 @@ class CRM_Case_Form_Activity_OpenCase { $form->add('wysiwyg', 'activity_details', ts('Details'), ['rows' => 4, 'cols' => 60], FALSE); $form->addButtons([ - [ - 'type' => 'upload', - 'name' => ts('Save'), - 'isDefault' => TRUE, - 'submitOnce' => TRUE, - ], - [ - 'type' => 'upload', - 'name' => ts('Save and New'), - 'subName' => 'new', - 'submitOnce' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'upload', + 'name' => ts('Save'), + 'isDefault' => TRUE, + 'submitOnce' => TRUE, + ], + [ + 'type' => 'upload', + 'name' => ts('Save and New'), + 'subName' => 'new', + 'submitOnce' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** diff --git a/CRM/Case/Form/Case.php b/CRM/Case/Form/Case.php index 87885469db..f988aba145 100644 --- a/CRM/Case/Form/Case.php +++ b/CRM/Case/Form/Case.php @@ -239,18 +239,17 @@ class CRM_Case_Form_Case extends CRM_Core_Form { $title = ts('Restore'); } $this->addButtons([ - [ - 'type' => 'next', - 'name' => $title, - 'spacing' => '         ', - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => $title, + 'spacing' => '         ', + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); return; } @@ -283,18 +282,17 @@ class CRM_Case_Form_Case extends CRM_Core_Form { CRM_Core_Form_Tag::buildQuickForm($this, $parentNames, 'civicrm_case', NULL, FALSE, TRUE); $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Save'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Save'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); $className = "CRM_Case_Form_Activity_{$this->_activityTypeFile}"; $className::buildQuickForm($this); diff --git a/CRM/Case/Form/CaseView.php b/CRM/Case/Form/CaseView.php index dd479144b4..fdf587ca58 100644 --- a/CRM/Case/Form/CaseView.php +++ b/CRM/Case/Form/CaseView.php @@ -148,9 +148,9 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form { $this->assign('hasRelatedCases', (bool) $relatedCases); if ($relatedCases) { $this->assign('relatedCaseLabel', ts('%1 Related Case', [ - 'count' => count($relatedCases), - 'plural' => '%1 Related Cases', - ])); + 'count' => count($relatedCases), + 'plural' => '%1 Related Cases', + ])); $this->assign('relatedCaseUrl', CRM_Utils_System::url('civicrm/contact/view/case', [ 'id' => $this->_caseID, 'cid' => $this->_contactID, @@ -398,14 +398,13 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form { CRM_Core_Form_Tag::buildQuickForm($this, $parentNames, 'civicrm_case', $this->_caseID, FALSE, TRUE); $this->addButtons([ - [ - 'type' => 'cancel', - 'name' => ts('Done'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'cancel', + 'name' => ts('Done'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ], + ]); } /** diff --git a/CRM/Case/Form/CustomData.php b/CRM/Case/Form/CustomData.php index 0ff5a3dde9..46f3754149 100644 --- a/CRM/Case/Form/CustomData.php +++ b/CRM/Case/Form/CustomData.php @@ -99,17 +99,16 @@ class CRM_Case_Form_CustomData extends CRM_Core_Form { // make this form an upload since we dont know if the custom data injected dynamically // is of type file etc $this->addButtons([ - [ - 'type' => 'upload', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'upload', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** -- 2.25.1