From 0db6c3e15a8324d7f2d73c43c9b219a829351157 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 6 Jan 2015 19:21:31 -0800 Subject: [PATCH] INFRA-132 - Put "else" and "catch" on new line --- CRM/ACL/BAO/Cache.php | 3 ++- CRM/Activity/Page/AJAX.php | 3 ++- CRM/Admin/Form/Extensions.php | 6 +++-- CRM/Admin/Form/Job.php | 3 ++- CRM/Admin/Form/Options.php | 3 ++- CRM/Admin/Form/Setting/Smtp.php | 3 ++- CRM/Admin/Page/Admin.php | 3 ++- CRM/Admin/Page/Extensions.php | 6 +++-- CRM/Campaign/Form/Survey/Delete.php | 3 ++- CRM/Campaign/Page/DashBoard.php | 3 ++- CRM/Case/BAO/CaseType.php | 3 ++- CRM/Case/PseudoConstant.php | 3 ++- CRM/Case/XMLRepository.php | 3 ++- CRM/Contact/BAO/Contact/Permission.php | 3 ++- CRM/Contact/BAO/Contact/Utils.php | 3 ++- CRM/Contact/BAO/GroupContactCache.php | 6 +++-- CRM/Contact/BAO/SavedSearch.php | 3 ++- CRM/Contact/Form/Task/Delete.php | 3 ++- CRM/Contact/Form/Task/SMSCommon.php | 3 ++- CRM/Contact/Page/View.php | 3 ++- CRM/Contribute/BAO/Query.php | 9 ++++--- CRM/Contribute/Form/Contribution/Main.php | 9 ++++--- .../Form/Contribution/OnBehalfOf.php | 3 ++- CRM/Contribute/Form/Contribution/ThankYou.php | 3 ++- CRM/Contribute/Form/ContributionBase.php | 3 ++- CRM/Contribute/Form/ContributionCharts.php | 3 ++- .../Form/ContributionPage/AddProduct.php | 3 ++- CRM/Contribute/Form/ManagePremiums.php | 18 ++++++++----- CRM/Contribute/Form/Task.php | 3 ++- CRM/Contribute/Form/UpdateBilling.php | 3 ++- CRM/Contribute/Form/UpdateSubscription.php | 3 ++- CRM/Contribute/Selector/Search.php | 3 ++- CRM/Core/BAO/ActionSchedule.php | 6 +++-- CRM/Core/BAO/CMSUser.php | 3 ++- CRM/Core/BAO/CustomValueTable.php | 3 ++- CRM/Core/BAO/File.php | 3 ++- CRM/Core/BAO/Setting.php | 3 ++- CRM/Core/CodeGen/Config.php | 3 ++- CRM/Core/CodeGen/Main.php | 3 ++- CRM/Core/CodeGen/Util/Template.php | 3 ++- CRM/Core/Config.php | 3 ++- CRM/Core/DAO.php | 6 +++-- CRM/Core/Error.php | 9 ++++--- CRM/Core/Form.php | 6 +++-- CRM/Core/IDS.php | 3 ++- CRM/Core/Invoke.php | 9 ++++--- CRM/Core/ManagedEntities.php | 15 +++++++---- CRM/Core/Payment/eWAY.php | 3 ++- CRM/Core/Reference/OptionValue.php | 6 +++-- CRM/Core/Resources.php | 3 ++- CRM/Core/Smarty.php | 6 +++-- CRM/Core/Smarty/plugins/block.crmRegion.php | 3 ++- .../Smarty/plugins/function.crmScript.php | 6 +++-- CRM/Core/Smarty/plugins/function.crmStyle.php | 6 +++-- CRM/Core/Transaction.php | 3 ++- CRM/Custom/Form/CustomData.php | 3 ++- CRM/Dedupe/Merger.php | 6 +++-- CRM/Event/Badge.php | 3 ++- CRM/Event/Form/Participant.php | 3 ++- CRM/Event/Form/Registration.php | 3 ++- CRM/Event/Form/Registration/Confirm.php | 3 ++- CRM/Event/Form/Registration/Register.php | 6 +++-- CRM/Event/Import/Field.php | 3 ++- CRM/Event/Page/EventInfo.php | 3 ++- CRM/Extension/Downloader.php | 3 ++- CRM/Extension/Manager.php | 27 ++++++++++++------- CRM/Extension/Manager/Module.php | 3 ++- CRM/Extension/Manager/Payment.php | 6 +++-- CRM/Extension/Mapper.php | 12 ++++++--- CRM/Extension/System.php | 9 ++++--- CRM/Friend/Form.php | 6 +++-- CRM/Logging/Differ.php | 3 ++- CRM/Logging/Schema.php | 6 +++-- CRM/Mailing/Info.php | 3 ++- CRM/Mailing/Selector/Browse.php | 3 ++- CRM/Member/BAO/MembershipType.php | 3 ++- CRM/Member/Form/Membership.php | 3 ++- CRM/Member/Import/Parser/Membership.php | 6 +++-- CRM/Price/BAO/PriceField.php | 9 ++++--- CRM/Profile/Form.php | 21 ++++++++++----- CRM/Profile/Form/Edit.php | 3 ++- CRM/Profile/Page/Dynamic.php | 6 +++-- CRM/Queue/Runner.php | 3 ++- CRM/Report/BAO/ReportInstance.php | 6 +++-- CRM/Report/Form/Event/Income.php | 3 ++- CRM/Report/Form/Instance.php | 6 +++-- CRM/Report/Page/InstanceList.php | 6 +++-- CRM/Report/Page/TemplateList.php | 3 ++- CRM/SMS/Page/Callback.php | 3 ++- CRM/SMS/Provider.php | 3 ++- CRM/Upgrade/Form.php | 3 ++- CRM/Upgrade/Incremental/Legacy.php | 3 ++- CRM/Upgrade/Incremental/php/FourThree.php | 3 ++- CRM/Upgrade/Incremental/php/FourTwo.php | 15 +++++++---- CRM/Upgrade/Page/Upgrade.php | 6 +++-- CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php | 15 +++++++---- .../Snapshot/V4p2/Price/BAO/LineItem.php | 3 ++- CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php | 6 +++-- .../Snapshot/V4p2/Price/DAO/FieldValue.php | 6 +++-- .../Snapshot/V4p2/Price/DAO/LineItem.php | 6 +++-- CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php | 6 +++-- .../Snapshot/V4p2/Price/DAO/SetEntity.php | 6 +++-- CRM/Utils/API/HTMLInputCoder.php | 6 +++-- CRM/Utils/API/NullOutputCoder.php | 3 ++- CRM/Utils/Array.php | 9 ++++--- CRM/Utils/Cache/SqlGroup.php | 6 +++-- CRM/Utils/Constant.php | 3 ++- CRM/Utils/DeprecatedUtils.php | 6 +++-- CRM/Utils/FakeObject.php | 3 ++- CRM/Utils/File.php | 9 ++++--- CRM/Utils/GlobalStack.php | 6 +++-- CRM/Utils/Network.php | 3 ++- CRM/Utils/REST.php | 6 +++-- CRM/Utils/Signer.php | 6 +++-- CRM/Utils/Sort.php | 3 ++- CRM/Utils/System.php | 6 +++-- CRM/Utils/System/Drupal.php | 6 +++-- CRM/Utils/System/Drupal6.php | 3 ++- CRM/Utils/System/Drupal8.php | 3 ++- CRM/Utils/System/Joomla.php | 3 ++- CRM/Utils/System/WordPress.php | 6 +++-- CRM/Utils/XML.php | 3 ++- CRM/Utils/Zip.php | 12 ++++++--- Civi/CiUtil/Command/CompareCommand.php | 3 ++- api/v3/CaseType.php | 3 ++- api/v3/Extension.php | 21 ++++++++++----- api/v3/Generic.php | 6 +++-- api/v3/Job.php | 3 ++- api/v3/utils.php | 6 +++-- bin/cli.class.php | 3 ++- install/index.php | 3 ++- .../CRM/Contact/BAO/GroupContactCacheTest.php | 3 ++- .../CRM/Core/BAO/ActionScheduleTest.php | 3 ++- .../Core/BAO/CustomValueTableSetGetTest.php | 6 +++-- tests/phpunit/CRM/Core/InnoDBIndexerTest.php | 3 ++- .../phpunit/CRM/Core/ManagedEntitiesTest.php | 9 ++++--- tests/phpunit/CRM/Core/TransactionTest.php | 12 ++++++--- .../CRM/Extension/Container/BasicTest.php | 12 ++++++--- .../Extension/Container/CollectionTest.php | 6 +++-- .../CRM/Extension/Container/StaticTest.php | 6 +++-- tests/phpunit/CRM/Extension/InfoTest.php | 6 +++-- .../CRM/Extension/Manager/PaymentTest.php | 3 ++- tests/phpunit/CRM/Utils/SQL/SelectTest.php | 9 ++++--- tests/phpunit/CiviTest/CiviReportTestCase.php | 3 ++- .../CiviTest/civicrm.settings.dist.php | 9 ++++--- tests/phpunit/EnvTests.php | 3 ++- tests/phpunit/Utils.php | 3 ++- tests/phpunit/WebTest/Mailing/MailingTest.php | 6 +++-- .../Report/RolePermissionReportTest.php | 3 ++- tests/phpunit/api/v3/APIStandardsTest.php | 3 ++- tests/phpunit/api/v3/UtilsTest.php | 6 +++-- 151 files changed, 530 insertions(+), 265 deletions(-) diff --git a/CRM/ACL/BAO/Cache.php b/CRM/ACL/BAO/Cache.php index a22f00a3a1..3c5b01f941 100644 --- a/CRM/ACL/BAO/Cache.php +++ b/CRM/ACL/BAO/Cache.php @@ -166,7 +166,8 @@ WHERE modified_date IS NULL CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, function(){ CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache"); }); - } else { + } + else { CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache"); } } diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 423b72fed7..28d2a41f25 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -235,7 +235,8 @@ class CRM_Activity_Page_AJAX { $rel['email'] = ''; $rel['source'] = 'caseRoles'; $caseRelationships[] = $rel; - } else { + } + else { foreach($value as $clientRole) { $relClient = array(); $relClient['relation'] = 'Client'; diff --git a/CRM/Admin/Form/Extensions.php b/CRM/Admin/Form/Extensions.php index 44889c9687..31be15dfd0 100644 --- a/CRM/Admin/Form/Extensions.php +++ b/CRM/Admin/Form/Extensions.php @@ -179,7 +179,8 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form { try { CRM_Extension_System::singleton()->getManager()->uninstall(array($this->_key)); CRM_Core_Session::setStatus("", ts('Extension Uninstalled'), "success"); - } catch (CRM_Extension_Exception_DependencyException $e) { + } + catch (CRM_Extension_Exception_DependencyException $e) { // currently only thrown for payment-processor dependencies CRM_Core_Session::setStatus(ts('Cannot uninstall this extension - there is at least one payment processor using the payment processor type provided by it.'), ts('Uninstall Error'), 'error'); } @@ -207,7 +208,8 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form { )); if (! CRM_Utils_Array::value('is_error', $result, FALSE)) { CRM_Core_Session::setStatus("", ts('Extension Upgraded'), "success"); - } else { + } + else { CRM_Core_Session::setStatus($result['error_message'], ts('Extension Upgrade Failed'), "error"); } } diff --git a/CRM/Admin/Form/Job.php b/CRM/Admin/Form/Job.php index 2f1a741382..be4d4542ca 100644 --- a/CRM/Admin/Form/Job.php +++ b/CRM/Admin/Form/Job.php @@ -124,7 +124,8 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form { $apiRequest = \Civi\API\Request::create($fields['api_entity'], $fields['api_action'], array('version' => 3), NULL); try { $apiKernel->resolve($apiRequest); - } catch (\Civi\API\Exception\NotImplementedException $e) { + } + catch (\Civi\API\Exception\NotImplementedException $e) { $errors['api_action'] = ts('Given API command is not defined.'); } diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index 13934263ad..a77b1032d2 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -415,7 +415,8 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { if ($this->_id && !array_key_exists('filter', $params)) { if ($this->_gName == 'participant_role') { $params['filter'] = 0; - } else { + } + else { $params['filter'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'filter', 'id'); } } diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php index e567163f82..55651fe3bd 100644 --- a/CRM/Admin/Form/Setting/Smtp.php +++ b/CRM/Admin/Form/Setting/Smtp.php @@ -91,7 +91,8 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting { if ($buttonName == $this->_testButtonName) { if ($formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_DISABLED) { CRM_Core_Session::setStatus(ts('You have selected "Disable Outbound Email". A test email can not be sent.'), ts("Email Disabled"), "error"); - } elseif ( $formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB ) { + } + elseif ( $formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB ) { CRM_Core_Session::setStatus(ts('You have selected "Redirect to Database". A test email can not be sent.'), ts("Email Disabled"), "error"); } else { diff --git a/CRM/Admin/Page/Admin.php b/CRM/Admin/Page/Admin.php index e62f83c667..40df721971 100644 --- a/CRM/Admin/Page/Admin.php +++ b/CRM/Admin/Page/Admin.php @@ -108,7 +108,8 @@ class CRM_Admin_Page_Admin extends CRM_Core_Page { $adminPanel[$groupId]['show'] = $v['show']; $adminPanel[$groupId]['hide'] = $v['hide']; $adminPanel[$groupId]['title'] = $title; - } else { + } + else { $adminPanel[$groupId] = array(); $adminPanel[$groupId]['show'] = ''; $adminPanel[$groupId]['hide'] = ''; diff --git a/CRM/Admin/Page/Extensions.php b/CRM/Admin/Page/Extensions.php index 8edf380a75..0dbb4a2b44 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 { foreach($keys as $key) { try { $obj = $mapper->keyToInfo($key); - } catch (CRM_Extension_Exception $ex) { + } + catch (CRM_Extension_Exception $ex) { CRM_Core_Session::setStatus(ts('Failed to read extension (%1). Please refresh the extension list.', array(1 => $key))); continue; } @@ -298,7 +299,8 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { $extensionRow = (array) $obj; try { $extensionRow['path'] = $mapper->keyToBasePath($obj->key); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $extensionRow['path'] = ''; } $extensionRow['status'] = $manager->getStatus($obj->key); diff --git a/CRM/Campaign/Form/Survey/Delete.php b/CRM/Campaign/Form/Survey/Delete.php index a6bc4991cf..ff91793985 100644 --- a/CRM/Campaign/Form/Survey/Delete.php +++ b/CRM/Campaign/Form/Survey/Delete.php @@ -101,7 +101,8 @@ class CRM_Campaign_Form_Survey_Delete extends CRM_Core_Form { CRM_Campaign_BAO_Survey::del($this->_surveyId); CRM_Core_Session::setStatus('', ts("'%1' survey has been deleted.", array(1 => $this->_surveyTitle)), 'success'); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey')); - } else { + } + else { CRM_Core_Error::fatal(ts('Delete action is missing expected survey ID.')); } } diff --git a/CRM/Campaign/Page/DashBoard.php b/CRM/Campaign/Page/DashBoard.php index ac5f285983..472fb14c7c 100644 --- a/CRM/Campaign/Page/DashBoard.php +++ b/CRM/Campaign/Page/DashBoard.php @@ -334,7 +334,8 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { if ($surveysData[$sid]['result_id']) { $resultSet = '' . ts('Result Set') . ''; $surveysData[$sid]['result_id'] = $resultSet; - } else { + } + else { $resultUrl = CRM_Utils_System::url("civicrm/survey/configure/results", "action=update&id={$sid}&reset=1"); $surveysData[$sid]['result_id'] = "(" . ts('Incomplete. Click to configure result set.') . ')'; } diff --git a/CRM/Case/BAO/CaseType.php b/CRM/Case/BAO/CaseType.php index 699ec1ca21..d17a4aafb4 100644 --- a/CRM/Case/BAO/CaseType.php +++ b/CRM/Case/BAO/CaseType.php @@ -91,7 +91,8 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { protected function assignTestValue($fieldName, &$fieldDef, $counter) { if ($fieldName == 'definition') { $this->{$fieldName} = "TestCaseType{$counter}"; - } else { + } + else { parent::assignTestValue($fieldName, $fieldDef, $counter); } } diff --git a/CRM/Case/PseudoConstant.php b/CRM/Case/PseudoConstant.php index d22e4d8524..8795b03288 100644 --- a/CRM/Case/PseudoConstant.php +++ b/CRM/Case/PseudoConstant.php @@ -144,7 +144,8 @@ class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant { public static function caseType($column = 'title', $onlyActive = TRUE) { if ($onlyActive) { $condition = " is_active = 1 "; - } else { + } + else { $condition = NULL; } $caseType = NULL; diff --git a/CRM/Case/XMLRepository.php b/CRM/Case/XMLRepository.php index 0be96d708b..8ec73aabfe 100644 --- a/CRM/Case/XMLRepository.php +++ b/CRM/Case/XMLRepository.php @@ -98,7 +98,8 @@ class CRM_Case_XMLRepository { $fileXml = $this->retrieveFile($caseType); if ($fileXml) { $this->xml[$caseType] = $fileXml; - } else { + } + else { return FALSE; } } diff --git a/CRM/Contact/BAO/Contact/Permission.php b/CRM/Contact/BAO/Contact/Permission.php index ca887e15cc..61f2ce62f1 100644 --- a/CRM/Contact/BAO/Contact/Permission.php +++ b/CRM/Contact/BAO/Contact/Permission.php @@ -381,7 +381,8 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR if ($checkSumValidationResult && $form && CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE)) { // if result is already validated, and url has cs, set the flag. $session->set('authSrc', CRM_Core_Permission::AUTH_SRC_CHECKSUM); - } else if (($session->get('authSrc') & CRM_Core_Permission::AUTH_SRC_CHECKSUM) == CRM_Core_Permission::AUTH_SRC_CHECKSUM) { + } + else if (($session->get('authSrc') & CRM_Core_Permission::AUTH_SRC_CHECKSUM) == CRM_Core_Permission::AUTH_SRC_CHECKSUM) { // if checksum wasn't present in REQUEST OR checksum result validated as FALSE, // and flag was already set exactly as AUTH_SRC_CHECKSUM, unset it. $session->set('authSrc', CRM_Core_Permission::AUTH_SRC_UNKNOWN); diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 53a67454fe..915191fb7a 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -854,7 +854,8 @@ Group By componentId"; if (!in_array($field, $skipFields)){ if (isset($masterAddress->$field)) { $values[$field] = $masterAddress->$field; - } else { + } + else { $values[$field] = ''; } } diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index 0e0675293c..0fe643e053 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -305,11 +305,13 @@ WHERE id IN ( $groupIDs ) if ($groupID == NULL) { $invoked = TRUE; - } else if (is_array($groupID)) { + } + else if (is_array($groupID)) { foreach ($groupID as $gid) { unset(self::$_alreadyLoaded[$gid]); } - } else if ($groupID && array_key_exists($groupID, self::$_alreadyLoaded)) { + } + else if ($groupID && array_key_exists($groupID, self::$_alreadyLoaded)) { unset(self::$_alreadyLoaded[$groupID]); } diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index 782b1f7c05..18e2118d87 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -167,7 +167,8 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { if ($params) { if (!empty($params['customSearchID'])) { // this has not yet been implemented - } else { + } + else { return CRM_Contact_BAO_Query::getWhereClause($params, NULL, $tables, $whereTables); } } diff --git a/CRM/Contact/Form/Task/Delete.php b/CRM/Contact/Form/Task/Delete.php index 08edbdace4..264508fef0 100644 --- a/CRM/Contact/Form/Task/Delete.php +++ b/CRM/Contact/Form/Task/Delete.php @@ -88,7 +88,8 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task { if ($cid) { if (!CRM_Contact_BAO_Contact_Permission::allow($cid, CRM_Core_Permission::EDIT)) { CRM_Core_Error::fatal(ts('You do not have permission to delete this contact. Note: you can delete contacts if you can edit them.')); - } elseif (CRM_Contact_BAO_Contact::checkDomainContact($cid)) { + } + elseif (CRM_Contact_BAO_Contact::checkDomainContact($cid)) { CRM_Core_Error::fatal(ts('This contact is a special one for the contact information associated with the CiviCRM installation for this domain. No one is allowed to delete it because the information is used for special system purposes.')); } diff --git a/CRM/Contact/Form/Task/SMSCommon.php b/CRM/Contact/Form/Task/SMSCommon.php index 6d060f8b08..2ca5b46f16 100644 --- a/CRM/Contact/Form/Task/SMSCommon.php +++ b/CRM/Contact/Form/Task/SMSCommon.php @@ -415,7 +415,8 @@ class CRM_Contact_Form_Task_SMSCommon { } $status .= ''; CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array('count' => count($sent), 'plural' => '%count Messages Not Sent')), 'info'); - } else { + } + else { //Display the name and number of contacts for those sms is not sent. $smsNotSent = array_diff_assoc($allContactIds, $contactIds); diff --git a/CRM/Contact/Page/View.php b/CRM/Contact/Page/View.php index 133cb93735..bfd3a63b63 100644 --- a/CRM/Contact/Page/View.php +++ b/CRM/Contact/Page/View.php @@ -227,7 +227,8 @@ class CRM_Contact_Page_View extends CRM_Core_Page { // Check if this is default domain contact CRM-10482 if (CRM_Contact_BAO_Contact::checkDomainContact($this->_contactId)) { $this->assign('domainContact', TRUE); - } else { + } + else { $this->assign('domainContact', FALSE); } diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 80c9c9e803..26c360547d 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -382,12 +382,14 @@ class CRM_Contribute_BAO_Query { $query->_qill[$grouping][] = ts('Contributions OR Soft Credits? - Soft Credits Only'); $query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1; $query->_tables['civicrm_contribution_soft'] = $query->_whereTables['civicrm_contribution_soft'] = 1; - } else if ($value == 'both_related') { + } + else if ($value == 'both_related') { $query->_where[$grouping][] = "contribution_search_scredit_combined.filter_id IS NOT NULL"; $query->_qill[$grouping][] = ts('Contributions OR Soft Credits? - Soft Credits with related Hard Credit'); $query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1; $query->_tables['civicrm_contribution_soft'] = $query->_whereTables['civicrm_contribution_soft'] = 1; - } else if ($value == 'both') { + } + else if ($value == 'both') { $query->_qill[$grouping][] = ts('Contributions OR Soft Credits? - Both'); $query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1; $query->_tables['civicrm_contribution_soft'] = $query->_whereTables['civicrm_contribution_soft'] = 1; @@ -790,7 +792,8 @@ class CRM_Contribute_BAO_Query { if (in_array(self::$_contribOrSoftCredit, array("only_scredits", "both_related", "both"))) { $from .= " $side JOIN civicrm_contact civicrm_contact_d ON (civicrm_contribution.contact_id = civicrm_contact_d.id ) AND contribution_search_scredit_combined.scredit_id IS NOT NULL"; - } else { + } + else { $from .= " $side JOIN civicrm_contact civicrm_contact_d ON (civicrm_contribution_soft.contact_id = civicrm_contact_d.id )"; } break; diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 0c8d042bd1..e88a5219be 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -602,7 +602,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if ($billingModePaymentProcessors && count($this->_paymentProcessors) == $billingModePaymentProcessors) { $allAreBillingModeProcessors = TRUE; - } else { + } + else { $allAreBillingModeProcessors = FALSE; } @@ -688,7 +689,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $unit .= "(s)"; } $form->assign('frequency_unit', $unit); - } else { + } + else { $form->assign('one_frequency_unit', FALSE); $units = array(); $frequencyUnits = CRM_Core_OptionGroup::values('recur_frequency_units'); @@ -1298,7 +1300,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if ($this->_membershipBlock['is_separate_payment'] && !empty($params['separate_amount'])) { $this->set('amount', $params['separate_amount']); - } else { + } + else { $this->set('amount', $params['amount']); } diff --git a/CRM/Contribute/Form/Contribution/OnBehalfOf.php b/CRM/Contribute/Form/Contribution/OnBehalfOf.php index d4de8f8508..d7200c7972 100644 --- a/CRM/Contribute/Form/Contribution/OnBehalfOf.php +++ b/CRM/Contribute/Form/Contribution/OnBehalfOf.php @@ -77,7 +77,8 @@ class CRM_Contribute_Form_Contribution_OnBehalfOf { // if _membershipContactID belongs to employers list, we can say: $form->_relatedOrganizationFound = TRUE; } - } else if (!empty($form->_employers)) { + } + else if (!empty($form->_employers)) { // not a renewal case and _employers list is not empty $form->_relatedOrganizationFound = TRUE; } diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index 05523c1a6c..ba3d69cd8e 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -105,7 +105,8 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont } if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) { $this->assign('lineItem', $this->_lineItem); - } else { + } + else { if (is_array($membershipTypeID)) { $membershipTypeID = current($membershipTypeID); } diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 7df238d58a..26cba8ce6a 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -247,7 +247,8 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { $this->assign('membershipContactID', $this->_membershipContactID); $this->assign('membershipContactName', $employers[$this->_membershipContactID]['name']); $validMembership = TRUE; - } else { + } + else { $membershipType = new CRM_Member_BAO_MembershipType(); $membershipType->id = $membership->membership_type_id; if ($membershipType->find(TRUE)) { diff --git a/CRM/Contribute/Form/ContributionCharts.php b/CRM/Contribute/Form/ContributionCharts.php index 68af8adf4d..41bdba22c6 100644 --- a/CRM/Contribute/Form/ContributionCharts.php +++ b/CRM/Contribute/Form/ContributionCharts.php @@ -173,7 +173,8 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form { $yearlyChart = TRUE; if (!empty($config->fiscalYearStart) && ($config->fiscalYearStart['M'] !== 1 || $config->fiscalYearStart['d'] !== 1)) { $values['xLabelAngle'] = 45; - } else { + } + else { $values['xLabelAngle'] = 0; } } diff --git a/CRM/Contribute/Form/ContributionPage/AddProduct.php b/CRM/Contribute/Form/ContributionPage/AddProduct.php index f63547aa21..0ee679cb22 100644 --- a/CRM/Contribute/Form/ContributionPage/AddProduct.php +++ b/CRM/Contribute/Form/ContributionPage/AddProduct.php @@ -84,7 +84,8 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For $defaults['product_id'] = $dao->product_id; $defaults['financial_type_id'] = $dao->financial_type_id; $defaults['weight'] = $dao->weight; - } else { + } + else { $dao = new CRM_Contribute_DAO_Product(); $dao->id = key($this->_products); $dao->find(TRUE); diff --git a/CRM/Contribute/Form/ManagePremiums.php b/CRM/Contribute/Form/ManagePremiums.php index fcd0c60eae..82a45b2014 100644 --- a/CRM/Contribute/Form/ManagePremiums.php +++ b/CRM/Contribute/Form/ManagePremiums.php @@ -307,19 +307,23 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { $params['image'] = $this->_resizeImage($imageFile, "_full", 200, 200); $params['thumbnail'] = $this->_resizeImage($imageFile, "_thumb", 50, 50); } - } else { + } + else { $error = TRUE; $params['image'] = $config->resourceBase . 'i/contribute/default_premium.jpg'; $params['thumbnail'] = $config->resourceBase . 'i/contribute/default_premium_thumb.jpg'; } - } elseif ($value == 'thumbnail') { + } + elseif ($value == 'thumbnail') { $params['image'] = $params['imageUrl']; $params['thumbnail'] = $params['thumbnailUrl']; - } elseif ($value == 'default_image') { + } + elseif ($value == 'default_image') { $url = parse_url($config->userFrameworkBaseURL); $params['image'] = $config->resourceBase . 'i/contribute/default_premium.jpg'; $params['thumbnail'] = $config->resourceBase . 'i/contribute/default_premium_thumb.jpg'; - } else { + } + else { $params['image'] = ""; $params['thumbnail'] = ""; } @@ -368,9 +372,11 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { $image = imagecreatetruecolor($width, $height); if($imageInfo['mime'] == 'image/gif') { $source = imagecreatefromgif($filename); - } elseif($imageInfo['mime'] == 'image/png') { + } + elseif($imageInfo['mime'] == 'image/png') { $source = imagecreatefrompng($filename); - } else { + } + else { $source = imagecreatefromjpeg($filename); } diff --git a/CRM/Contribute/Form/Task.php b/CRM/Contribute/Form/Task.php index 90c10e02e8..2e5e73c6d3 100644 --- a/CRM/Contribute/Form/Task.php +++ b/CRM/Contribute/Form/Task.php @@ -135,7 +135,8 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form { $contactIds = $contributionContactIds = array(); $query->_rowCountClause = " count(civicrm_contribution.id)"; $query->_groupByComponentClause = " GROUP BY contribution_search_scredit_combined.id, contribution_search_scredit_combined.contact_id, contribution_search_scredit_combined.scredit_id "; - } else { + } + else { $query->_distinctComponentClause = ' civicrm_contribution.id'; $query->_groupByComponentClause = ' GROUP BY civicrm_contribution.id '; } diff --git a/CRM/Contribute/Form/UpdateBilling.php b/CRM/Contribute/Form/UpdateBilling.php index 07b8d5b3f4..94879f1e29 100644 --- a/CRM/Contribute/Form/UpdateBilling.php +++ b/CRM/Contribute/Form/UpdateBilling.php @@ -422,7 +422,8 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { $userID = $session->get('userID'); if ( $userID && $status) { $session->setStatus($status, $msgTitle, $msgType); - } else if (!$userID) { + } + else if (!$userID) { if ($status) CRM_Utils_System::setUFMessage($status); $result = (int) ($updateSubscription && isset($ctype)); diff --git a/CRM/Contribute/Form/UpdateSubscription.php b/CRM/Contribute/Form/UpdateSubscription.php index 8c54e33e7a..453617d7d4 100644 --- a/CRM/Contribute/Form/UpdateSubscription.php +++ b/CRM/Contribute/Form/UpdateSubscription.php @@ -308,7 +308,8 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form { $userID = $session->get('userID'); if ( $userID && $status) { CRM_Core_Session::setStatus($status, $msgTitle, $msgType); - } else if (!$userID) { + } + else if (!$userID) { if ($status) CRM_Utils_System::setUFMessage($status); // keep result as 1, since we not displaying anything on the redirected page anyway diff --git a/CRM/Contribute/Selector/Search.php b/CRM/Contribute/Selector/Search.php index 3a3be90833..05e2ae2cc1 100644 --- a/CRM/Contribute/Selector/Search.php +++ b/CRM/Contribute/Selector/Search.php @@ -203,7 +203,8 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C if ($this->_includeSoftCredits) { $this->_query->_rowCountClause = " count(civicrm_contribution.id)"; $this->_query->_groupByComponentClause = " GROUP BY contribution_search_scredit_combined.id, contribution_search_scredit_combined.contact_id, contribution_search_scredit_combined.scredit_id "; - } else { + } + else { $this->_query->_distinctComponentClause = " civicrm_contribution.id"; $this->_query->_groupByComponentClause = " GROUP BY civicrm_contribution.id "; } diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index c5ed9d45d7..587ef5922c 100644 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -1152,7 +1152,8 @@ WHERE $group.id = {$actionSchedule->group_id} if ($isSmartGroup) { $join[] = "INNER JOIN civicrm_group_contact_cache grp ON {$contactField} = grp.contact_id"; $where[] = "grp.group_id IN ({$actionSchedule->group_id})"; - } else { + } + else { $join[] = "INNER JOIN civicrm_group_contact grp ON {$contactField} = grp.contact_id AND grp.status = 'Added'"; $where[] = "grp.group_id IN ({$actionSchedule->group_id})"; } @@ -1169,7 +1170,8 @@ WHERE $group.id = {$actionSchedule->group_id} if ($isSmartGroup) { $addGroup = " INNER JOIN civicrm_group_contact_cache grp ON c.id = grp.contact_id"; $addWhere = " grp.group_id IN ({$actionSchedule->group_id})"; - } else { + } + else { $addGroup = " INNER JOIN civicrm_group_contact grp ON c.id = grp.contact_id AND grp.status = 'Added'"; $addWhere = " grp.group_id IN ({$actionSchedule->group_id})"; } diff --git a/CRM/Core/BAO/CMSUser.php b/CRM/Core/BAO/CMSUser.php index 88aaf2f511..42f0d44f4d 100644 --- a/CRM/Core/BAO/CMSUser.php +++ b/CRM/Core/BAO/CMSUser.php @@ -365,7 +365,8 @@ class CRM_Core_BAO_CMSUser { if (!empty($form->_bltID) && array_key_exists("email-{$form->_bltID}", $fields)) { // this is a transaction related page $emailName = 'email-' . $form->_bltID; - } else { + } + else { // find the email field in a profile page foreach ($fields as $name => $dontCare) { if (substr($name, 0, 5) == 'email') { diff --git a/CRM/Core/BAO/CustomValueTable.php b/CRM/Core/BAO/CustomValueTable.php index 15d6290e00..2b1ca78553 100644 --- a/CRM/Core/BAO/CustomValueTable.php +++ b/CRM/Core/BAO/CustomValueTable.php @@ -465,7 +465,8 @@ AND $cond else { $result["{$dao->id}"]["{$fieldID}"] = $dao->$fieldName; } - } else { + } + else { $result["{$fieldID}_{$dao->id}"] = $dao->$fieldName; } } diff --git a/CRM/Core/BAO/File.php b/CRM/Core/BAO/File.php index ee584c68a0..097beaa2e3 100644 --- a/CRM/Core/BAO/File.php +++ b/CRM/Core/BAO/File.php @@ -346,7 +346,8 @@ FROM civicrm_file AS CF LEFT JOIN civicrm_entity_file AS CEF ON ( CEF.file_id = CF.id ) WHERE CF.id = %2"; - } else { + } + else { $sql = " SELECT CF.id as cfID, CF.uri as uri, diff --git a/CRM/Core/BAO/Setting.php b/CRM/Core/BAO/Setting.php index a4602f9e1c..6a38775c53 100644 --- a/CRM/Core/BAO/Setting.php +++ b/CRM/Core/BAO/Setting.php @@ -795,7 +795,8 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { $domain->find(TRUE); if ($domain->config_backend) { $values = unserialize($domain->config_backend); - } else { + } + else { $values = array(); } $spec = self::getSettingSpecification(NULL, array('name' => $name), $domainID); diff --git a/CRM/Core/CodeGen/Config.php b/CRM/Core/CodeGen/Config.php index 9acf881daf..086169ff52 100644 --- a/CRM/Core/CodeGen/Config.php +++ b/CRM/Core/CodeGen/Config.php @@ -25,7 +25,8 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { if ($configTemplate) { echo "Generating civicrm.config.php\n"; copy($configTemplate, '../civicrm.config.php'); - } else { + } + else { throw new Exception("Failed to locate template for civicrm.config.php"); } } diff --git a/CRM/Core/CodeGen/Main.php b/CRM/Core/CodeGen/Main.php index 3c9c37c3f3..f359e76716 100644 --- a/CRM/Core/CodeGen/Main.php +++ b/CRM/Core/CodeGen/Main.php @@ -114,7 +114,8 @@ Alternatively you can get a version of CiviCRM that matches your PHP version if (is_a($task, 'CRM_Core_CodeGen_ITask')) { $task->setConfig($this); $task->run(); - } else { + } + else { echo "Bad news: we tried to run a codegen task of an unrecognized type: {$component}\n"; exit(); } diff --git a/CRM/Core/CodeGen/Util/Template.php b/CRM/Core/CodeGen/Util/Template.php index 5f6b2f09b2..9924f6dcbf 100644 --- a/CRM/Core/CodeGen/Util/Template.php +++ b/CRM/Core/CodeGen/Util/Template.php @@ -68,7 +68,8 @@ class CRM_Core_CodeGen_Util_Template { $this->beautifier->setOutputFile($outpath); $this->beautifier->process(); $this->beautifier->save(); - } else { + } + else { file_put_contents($outpath, $renderedContents); } } diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index 94d4457072..8912a343db 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -741,7 +741,8 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { $this->userPermissionClass->upgradePermissions( CRM_Core_Permission::basicPermissions() ); - } else { + } + else { // Cannot store permissions -- warn if any modules require them $modules_with_perms = array(); foreach ($module_files as $module_file) { diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 2b686b3ecc..ec2073ae97 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -1519,7 +1519,8 @@ SELECT contact_id if (!defined('CIVICRM_DSN')) { if (function_exists('mysql_real_escape_string')) { return mysql_real_escape_string($string); - } else { + } + else { throw new CRM_Core_Exception("Cannot generate SQL. \"mysql_real_escape_string\" is missing. Have you installed PHP \"mysql\" extension?"); } } @@ -1624,7 +1625,8 @@ SELECT contact_id if ($FKClassName != NULL) { $object->assignTestFK($fieldName, $fieldDef, $params); continue; - } else { + } + else { $object->assignTestValue($fieldName, $fieldDef, $counter); } } diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index a0a2d99409..0fc3f0531c 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -401,7 +401,8 @@ class CRM_Core_Error extends PEAR_ErrorStack { public static function handleUnhandledException($exception) { try { CRM_Utils_Hook::unhandledException($exception); - } catch (Exception $other) { + } + catch (Exception $other) { // if the exception-handler generates an exception, then that sucks! oh, well. carry on. CRM_Core_Error::debug_var('handleUnhandledException_nestedException', self::formatTextException($other)); } @@ -607,7 +608,8 @@ class CRM_Core_Error extends PEAR_ErrorStack { if ( defined( 'CIVICRM_DEBUG_LOG_QUERY' ) ) { if ( CIVICRM_DEBUG_LOG_QUERY == 'backtrace' ) { CRM_Core_Error::backtrace( $string, TRUE ); - } else if ( CIVICRM_DEBUG_LOG_QUERY ) { + } + else if ( CIVICRM_DEBUG_LOG_QUERY ) { CRM_Core_Error::debug_var( 'Query', $string, FALSE, TRUE ); } } @@ -802,7 +804,8 @@ class CRM_Core_Error extends PEAR_ErrorStack { $ei = $ei->getCause(); } $msg .= $e->toHtml(); - } else { + } + else { $msg .= '

' . get_class($e) . ': "' . htmlentities($e->getMessage()) . '"

'; $msg .= '
' . htmlentities(self::formatBacktrace($e->getTrace())) . '
'; } diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index f4aafa52a0..084b5450ed 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -996,7 +996,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { if ($displayTime) { $this->addDateTime($name . $from, $label, $required, array('formatType' => $dateFormat)); $this->addDateTime($name . $to, ts('To:'), $required, array('formatType' => $dateFormat)); - } else { + } + else { $this->addDate($name . $from, $label, $required, array('formatType' => $dateFormat)); $this->addDate($name . $to, ts('To:'), $required, array('formatType' => $dateFormat)); } @@ -1804,7 +1805,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { if (!$options) { $targetField->setAttribute('placeholder', $targetField->getAttribute('data-none-prompt')); } - } else { + } + else { $targetField->setAttribute('placeholder', $targetField->getAttribute('data-empty-prompt')); $targetField->setAttribute('disabled', 'disabled'); } diff --git a/CRM/Core/IDS.php b/CRM/Core/IDS.php index 13f31f1cae..75713269ee 100644 --- a/CRM/Core/IDS.php +++ b/CRM/Core/IDS.php @@ -77,7 +77,8 @@ class CRM_Core_IDS { try { $init = IDS_Init::init($configFile); $ids = new IDS_Monitor($_REQUEST, $init); - } catch (Exception $e) { + } + catch (Exception $e) { // might be an old stale copy of Config.IDS.ini // lets try to rebuild it again and see if it works $configFile = self::createConfigFile(TRUE); diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 236111391c..67f1adc801 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -81,7 +81,8 @@ class CRM_Core_Invoke { self::hackStandalone($args); $item = self::getItem($args); return self::runItem($item); - } else { + } + else { // Symfony-based invocation path require_once CIVICRM_SYMFONY_PATH . '/app/bootstrap.php.cache'; require_once CIVICRM_SYMFONY_PATH . '/app/AppKernel.php'; @@ -91,7 +92,8 @@ class CRM_Core_Invoke { if (preg_match(':^text/html:', $response->headers->get('Content-Type'))) { // let the CMS handle the trappings return $response->getContent(); - } else { + } + else { $response->send(); exit(); } @@ -169,7 +171,8 @@ class CRM_Core_Invoke { if (is_array($args)) { // get the menu items $path = implode('/', $args); - } else { + } + else { $path = $args; } $item = CRM_Core_Menu::get($path); diff --git a/CRM/Core/ManagedEntities.php b/CRM/Core/ManagedEntities.php index 7d8749bf65..5a562d6a1f 100644 --- a/CRM/Core/ManagedEntities.php +++ b/CRM/Core/ManagedEntities.php @@ -63,7 +63,8 @@ class CRM_Core_ManagedEntities { if ($declarations !== NULL) { $this->declarations = self::cleanDeclarations($declarations); - } else { + } + else { $this->declarations = NULL; } } @@ -89,7 +90,8 @@ class CRM_Core_ManagedEntities { $this->onApiError($dao->entity_type, 'getsingle', $params, $result); } return $result; - } else { + } + else { return NULL; } } @@ -113,9 +115,11 @@ class CRM_Core_ManagedEntities { foreach ($decls as $moduleName => $todos) { if (isset($this->moduleIndex[TRUE][$moduleName])) { $this->reconcileEnabledModule($this->moduleIndex[TRUE][$moduleName], $todos); - } elseif (isset($this->moduleIndex[FALSE][$moduleName])) { + } + elseif (isset($this->moduleIndex[FALSE][$moduleName])) { // do nothing -- module should get swept up later - } else { + } + else { throw new Exception("Entity declaration references invalid or inactive module name [$moduleName]"); } } @@ -137,7 +141,8 @@ class CRM_Core_ManagedEntities { // update existing entity; remove from $todos $this->updateExistingEntity($dao, $todos[$dao->name]); unset($todos[$dao->name]); - } else { + } + else { // remove stale entity; not in $todos $this->removeStaleEntity($dao); } diff --git a/CRM/Core/Payment/eWAY.php b/CRM/Core/Payment/eWAY.php index 4dfce475e7..ceb785e7b8 100644 --- a/CRM/Core/Payment/eWAY.php +++ b/CRM/Core/Payment/eWAY.php @@ -413,7 +413,8 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { $trxn_id = str_replace( 'test', '', $trxn_id ); $trxn_id = intval($trxn_id) + 1; $params['trxn_id'] = sprintf('test%08d', $trxn_id); - } else { + } + else { $params['trxn_id'] = $eWAYResponse->TransactionNumber(); } */ diff --git a/CRM/Core/Reference/OptionValue.php b/CRM/Core/Reference/OptionValue.php index eed0b5d93c..98a5b2df29 100644 --- a/CRM/Core/Reference/OptionValue.php +++ b/CRM/Core/Reference/OptionValue.php @@ -38,7 +38,8 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic { } if ($targetDao->option_group_id == $this->getTargetOptionGroupId()) { return parent::findReferences($targetDao); - } else { + } + else { return NULL; } } @@ -55,7 +56,8 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic { } if ($targetDao->option_group_id == $this->getTargetOptionGroupId()) { return parent::getReferenceCount($targetDao); - } else { + } + else { return NULL; } } diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index f21384b25e..b431eb30b5 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -605,7 +605,8 @@ class CRM_Core_Resources { $filePath = $this->getPath($ext, $file); if ($filePath && is_readable($filePath)) { $stringsByFile[$file] = CRM_Utils_JS::parseStrings(file_get_contents($filePath)); - } else { + } + else { $stringsByFile[$file] = array(); } $this->cache->set($ext, $stringsByFile); diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index 7c941d8cba..caf5925d5d 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -221,7 +221,8 @@ class CRM_Core_Smarty extends Smarty { $this->pushScope($vars); try { $result = $this->fetch($resource_name); - } catch (Exception $e) { + } + catch (Exception $e) { // simulate try { ... } finally { ... } $this->popScope(); throw $e; @@ -266,7 +267,8 @@ class CRM_Core_Smarty extends Smarty { public function addTemplateDir($path) { if ( is_array( $this->template_dir ) ) { array_unshift( $this->template_dir, $path ); - } else { + } + else { $this->template_dir = array( $path, $this->template_dir ); } diff --git a/CRM/Core/Smarty/plugins/block.crmRegion.php b/CRM/Core/Smarty/plugins/block.crmRegion.php index 4f185d7fb7..23166b3438 100644 --- a/CRM/Core/Smarty/plugins/block.crmRegion.php +++ b/CRM/Core/Smarty/plugins/block.crmRegion.php @@ -25,7 +25,8 @@ function smarty_block_crmRegion($params, $content, &$smarty, &$repeat) if ($region) { $result = $region->render($content, CRM_Utils_Array::value('allowCmsOverride', $params, TRUE)); return $result; - } else { + } + else { return $content; } } diff --git a/CRM/Core/Smarty/plugins/function.crmScript.php b/CRM/Core/Smarty/plugins/function.crmScript.php index 46971059d7..952b0b21d5 100644 --- a/CRM/Core/Smarty/plugins/function.crmScript.php +++ b/CRM/Core/Smarty/plugins/function.crmScript.php @@ -59,9 +59,11 @@ function smarty_function_crmScript($params, &$smarty) { if (array_key_exists('file', $params)) { $res->addScriptFile($params['ext'], $params['file'], $params['weight'], $params['region']); - } elseif (array_key_exists('url', $params)) { + } + elseif (array_key_exists('url', $params)) { $res->addScriptUrl($params['url'], $params['weight'], $params['region']); - } else { + } + else { CRM_Core_Error::debug_var('crmScript_params', $params); throw new Exception("crmScript requires url or ext+file"); } diff --git a/CRM/Core/Smarty/plugins/function.crmStyle.php b/CRM/Core/Smarty/plugins/function.crmStyle.php index 43c5dd9ec0..4a98660b67 100644 --- a/CRM/Core/Smarty/plugins/function.crmStyle.php +++ b/CRM/Core/Smarty/plugins/function.crmStyle.php @@ -59,9 +59,11 @@ function smarty_function_crmStyle($params, &$smarty) { if (array_key_exists('file', $params)) { $res->addStyleFile($params['ext'], $params['file'], $params['weight'], $params['region']); - } elseif (array_key_exists('url', $params)) { + } + elseif (array_key_exists('url', $params)) { $res->addStyleUrl($params['url'], $params['weight'], $params['region']); - } else { + } + else { CRM_Core_Error::debug_var('crmStyle_params', $params); throw new Exception("crmStyle requires url or ext+file"); } diff --git a/CRM/Core/Transaction.php b/CRM/Core/Transaction.php index 91dece866f..aad1beeef6 100644 --- a/CRM/Core/Transaction.php +++ b/CRM/Core/Transaction.php @@ -183,7 +183,8 @@ class CRM_Core_Transaction { public function run($callable) { try { $callable($this); - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->rollback()->commit(); throw $ex; } diff --git a/CRM/Custom/Form/CustomData.php b/CRM/Custom/Form/CustomData.php index c7fd99cb9b..433a460d7c 100644 --- a/CRM/Custom/Form/CustomData.php +++ b/CRM/Custom/Form/CustomData.php @@ -107,7 +107,8 @@ class CRM_Custom_Form_CustomData { $urlGroupId = CRM_Utils_Request::retrieve('groupID', 'Positive', CRM_Core_DAO::$_nullObject); if ( isset($typeCheck) && $urlGroupId) { $form->_groupID = $urlGroupId; - } else { + } + else { $form->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $form); } diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index cfef7dd500..2934f8a20f 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -1555,7 +1555,8 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m if ($other_sub_types = CRM_Utils_array::value('contact_sub_type', $migrationInfo['other_details'])) { if ($main_sub_types = CRM_Utils_array::value('contact_sub_type', $migrationInfo['main_details'])) { $submitted['contact_sub_type'] = array_unique( array_merge($main_sub_types, $other_sub_types)); - } else { + } + else { $submitted['contact_sub_type'] = $other_sub_types; } } @@ -1568,7 +1569,8 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m if ($currentEmloyerId = CRM_Utils_Array::value('current_employer_id', $submitted)) { if (!CRM_Utils_System::isNull($currentEmloyerId)) { $submitted['current_employer'] = $submitted['current_employer_id']; - } else { + } + else { $submitted['current_employer'] = ''; } unset($submitted['current_employer_id']); diff --git a/CRM/Event/Badge.php b/CRM/Event/Badge.php index e11044703c..7dd9349fc9 100644 --- a/CRM/Event/Badge.php +++ b/CRM/Event/Badge.php @@ -127,7 +127,8 @@ class CRM_Event_Badge { } } } - } else { + } + else { $imgFile = 'No template directories defined anywhere??'; } diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index de8c5d5d82..5a800e3596 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -998,7 +998,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment if ($this->_quickConfig && !empty($params['total_amount']) && $params['status_id'] != array_search('Partially paid', $participantStatus)) { $params['fee_amount'] = $params['total_amount']; - } else { + } + else { //fix for CRM-3086 $params['fee_amount'] = $params['amount']; } diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 3ccadb3ca3..ddb881f571 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -791,7 +791,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { if (array_key_exists('email-5', $this->_params)) { $mail = 'email-5'; - } else { + } + else { foreach ($this->_params as $name => $dontCare) { if (substr($name, 0, 5) == 'email') { $mail = $name; diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index d4ebee428b..031f670923 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -1220,7 +1220,8 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { if ($participantNum) { $prefix1 = 'additional'; $prefix2 = 'additional_'; - } else { + } + else { $prefix1 = ''; $prefix2 = ''; } diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 4cc735bdbb..0a397fafb6 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -493,7 +493,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { if ($billingModePaymentProcessors && count($this->_paymentProcessors) == $billingModePaymentProcessors) { $allAreBillingModeProcessors = TRUE; - } else { + } + else { $allAreBillingModeProcessors = FALSE; } @@ -515,7 +516,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { && !$this->_values['event']['is_confirm_enabled'] ) { $buttonLabel = ts('Register >>'); - } else { + } + else { $buttonLabel = ts('Continue >>'); } diff --git a/CRM/Event/Import/Field.php b/CRM/Event/Import/Field.php index fcc59e5059..c785340008 100644 --- a/CRM/Event/Import/Field.php +++ b/CRM/Event/Import/Field.php @@ -121,7 +121,8 @@ class CRM_Event_Import_Field { } if (in_array($this->_value, $events)) { return true; - } else { + } + else { return false; } break; diff --git a/CRM/Event/Page/EventInfo.php b/CRM/Event/Page/EventInfo.php index 056d6f4039..8d9583ba9a 100644 --- a/CRM/Event/Page/EventInfo.php +++ b/CRM/Event/Page/EventInfo.php @@ -105,7 +105,8 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { $discountId= CRM_Core_BAO_Discount::findSet($this->_id, 'civicrm_event'); if ($discountId) { $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $discountId, 'price_set_id'); - } else { + } + else { $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $this->_id); } diff --git a/CRM/Extension/Downloader.php b/CRM/Extension/Downloader.php index b8f152e3b0..26d6b1557c 100644 --- a/CRM/Extension/Downloader.php +++ b/CRM/Extension/Downloader.php @@ -208,7 +208,8 @@ class CRM_Extension_Downloader { try { $newInfo = CRM_Extension_Info::loadFromFile($filename); - } catch (Exception $e) { + } + catch (Exception $e) { CRM_Core_Session::setStatus(ts('Failed reading data from %1 during installation', array(1 => $filename)), ts('Installation Error'), 'error'); return FALSE; } diff --git a/CRM/Extension/Manager.php b/CRM/Extension/Manager.php index db6716c8e0..3cfca6397c 100644 --- a/CRM/Extension/Manager.php +++ b/CRM/Extension/Manager.php @@ -393,7 +393,8 @@ class CRM_Extension_Manager { $statuses = $this->getStatuses(); if (array_key_exists($key, $statuses)) { return $statuses[$key]; - } else { + } + else { return self::STATUS_UNKNOWN; } } @@ -420,12 +421,14 @@ class CRM_Extension_Manager { try { $path = $this->fullContainer->getPath($dao->full_name); $codeExists = !empty($path) && is_dir($path); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $codeExists = FALSE; } if ($dao->is_active) { $this->statuses[$dao->full_name] = $codeExists ? self::STATUS_INSTALLED : self::STATUS_INSTALLED_MISSING; - } else { + } + else { $this->statuses[$dao->full_name] = $codeExists ? self::STATUS_DISABLED : self::STATUS_DISABLED_MISSING; } } @@ -453,7 +456,8 @@ class CRM_Extension_Manager { $info = $this->mapper->keyToInfo($key); // throws Exception if (array_key_exists($info->type, $this->typeManagers)) { return array($info, $this->typeManagers[$info->type]); - } else { + } + else { throw new CRM_Extension_Exception("Unrecognized extension type: " . $info->type); } } @@ -471,10 +475,12 @@ class CRM_Extension_Manager { if ($info) { if (array_key_exists($info->type, $this->typeManagers)) { return array($info, $this->typeManagers[$info->type]); - } else { + } + else { throw new CRM_Extension_Exception("Unrecognized extension type: " . $info->type); } - } else { + } + else { throw new CRM_Extension_Exception("Failed to reconstruct missing extension: " . $key); } } @@ -511,7 +517,8 @@ class CRM_Extension_Manager { $dao->file = $info->file; $dao->is_active = 1; return (bool) ($dao->update()); - } else { + } + else { return $this->_createExtensionEntry($info); } } @@ -527,7 +534,8 @@ class CRM_Extension_Manager { if ($dao->find(TRUE)) { if (CRM_Core_BAO_Extension::del($dao->id)) { CRM_Core_Session::setStatus(ts('Selected option value has been deleted.'), ts('Deleted'), 'success'); - } else { + } + else { throw new CRM_Extension_Exception("Failed to remove extension entry"); } } // else: post-condition already satisified @@ -557,7 +565,8 @@ class CRM_Extension_Manager { if ($dao->find(TRUE)) { $info = new CRM_Extension_Info($dao->full_name, $dao->type, $dao->name, $dao->label, $dao->file); return $info; - } else { + } + else { return NULL; } } diff --git a/CRM/Extension/Manager/Module.php b/CRM/Extension/Manager/Module.php index ff750fc40f..2215a91c38 100644 --- a/CRM/Extension/Manager/Module.php +++ b/CRM/Extension/Manager/Module.php @@ -65,7 +65,8 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base { private function callHook(CRM_Extension_Info $info, $hookName) { try { $file = $this->mapper->keyToPath($info->key); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { return; } if (!file_exists($file)) { diff --git a/CRM/Extension/Manager/Payment.php b/CRM/Extension/Manager/Payment.php index 4fb95291ac..251e48e29c 100644 --- a/CRM/Extension/Manager/Payment.php +++ b/CRM/Extension/Manager/Payment.php @@ -195,10 +195,12 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base { if (! file_exists($file)) { CRM_Core_Session::setStatus(ts('Failed to load file (%3) for payment processor (%1) while running "%2"', array(1 => $info->key, 2 => $method, 3 => $file)), '', 'error'); return; - } else { + } + else { require_once $file; } - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { CRM_Core_Session::setStatus(ts('Failed to determine file path for payment processor (%1) while running "%2"', array(1 => $info->key, 2 => $method)), '', 'error'); return; } diff --git a/CRM/Extension/Mapper.php b/CRM/Extension/Mapper.php index fdf7c3c2ae..0766cf98de 100755 --- a/CRM/Extension/Mapper.php +++ b/CRM/Extension/Mapper.php @@ -97,13 +97,15 @@ class CRM_Extension_Mapper { $this->cacheKey = $cacheKey; if ($civicrmUrl) { $this->civicrmUrl = rtrim($civicrmUrl, '/'); - } else { + } + else { $config = CRM_Core_Config::singleton(); $this->civicrmUrl = rtrim($config->resourceBase, '/'); } if ($civicrmPath) { $this->civicrmPath = rtrim($civicrmPath, '/'); - } else { + } + else { global $civicrm_root; $this->civicrmPath = rtrim($civicrm_root, '/'); } @@ -180,7 +182,8 @@ class CRM_Extension_Mapper { if ($fresh || !array_key_exists($key, $this->infos)) { try { $this->infos[$key] = CRM_Extension_Info::loadFromFile($this->container->getPath($key) . DIRECTORY_SEPARATOR . CRM_Extension_Info::FILENAME); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { // file has more detailed info, but we'll fallback to DB if it's missing -- DB has enough info to uninstall $this->infos[$key] = CRM_Extension_System::singleton()->getManager()->createInfoFromDB($key); if (!$this->infos[$key]) { @@ -292,7 +295,8 @@ class CRM_Extension_Mapper { 'prefix' => $dao->file, 'filePath' => $this->keyToPath($dao->full_name), ); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { // Putting a stub here provides more consistency // in how getActiveModuleFiles when racing between // dirty file-removals and cache-clears. diff --git a/CRM/Extension/System.php b/CRM/Extension/System.php index 405be00550..021b3a6e62 100644 --- a/CRM/Extension/System.php +++ b/CRM/Extension/System.php @@ -61,7 +61,8 @@ class CRM_Extension_System { if (! self::$singleton || $fresh) { if (self::$singleton) { self::$singleton = new CRM_Extension_System(self::$singleton->parameters); - } else { + } + else { self::$singleton = new CRM_Extension_System(); } } @@ -136,7 +137,8 @@ class CRM_Extension_System { if ($this->defaultContainer === NULL) { if ($this->parameters['extensionsDir']) { $this->defaultContainer = new CRM_Extension_Container_Default($this->parameters['extensionsDir'], $this->parameters['extensionsURL'], $this->getCache(), 'default'); - } else { + } + else { $this->defaultContainer = FALSE; } } @@ -216,7 +218,8 @@ class CRM_Extension_System { 'group' => 'ext', 'prefetch' => TRUE, )); - } else { + } + else { $this->cache = new CRM_Utils_Cache_ArrayCache(array()); } } diff --git a/CRM/Friend/Form.php b/CRM/Friend/Form.php index 2d3ecec1bc..428741fd4c 100644 --- a/CRM/Friend/Form.php +++ b/CRM/Friend/Form.php @@ -86,7 +86,8 @@ class CRM_Friend_Form extends CRM_Core_Form { if ($pcomponent == 'event') { $this->_entityTable = 'civicrm_event'; $isShare = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_entityId, 'is_share'); - } else { + } + else { $isShare = CRM_Utils_Array::value('is_share', $values); } // Tell Form.tpl whether to include SocialNetwork.tpl for social media sharing @@ -303,7 +304,8 @@ class CRM_Friend_Form extends CRM_Core_Form { $this->assign('linkTextUrl', $linkTextUrl); $this->assign('linkText', $linkText); } - } else if ( $this->_entityTable == 'civicrm_event' ) { + } + else if ( $this->_entityTable == 'civicrm_event' ) { // If this is tell a friend after registering for an event, give donor link to create their own fundraising page require_once 'CRM/PCP/BAO/PCP.php'; if ( $linkText = CRM_PCP_BAO_PCP::getPcpBlockStatus( $defaults['entity_id'], $defaults['entity_table'] ) ) { diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index 04dc8866f8..f75b638394 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -313,7 +313,8 @@ WHERE lt.log_conn_id = %1 AND } elseif (substr($table, 0, 14) == 'civicrm_value_') { list($titles[$table], $values[$table]) = $this->titlesAndValuesForCustomDataTable($table); - } else { + } + else { $titles[$table] = $values[$table] = array(); } } diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index 9dcbe29eae..244617654d 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -449,11 +449,13 @@ WHERE table_schema IN ('{$this->db}', '{$civiDB}')"; if ($civiTableSpecs[$col]['DATA_TYPE'] != CRM_Utils_Array::value('DATA_TYPE', $logTableSpecs[$col])) { // if data-type is different, surely consider the column $diff['MODIFY'][] = $col; - } else if ($civiTableSpecs[$col]['IS_NULLABLE'] != CRM_Utils_Array::value('IS_NULLABLE', $logTableSpecs[$col]) && + } + else if ($civiTableSpecs[$col]['IS_NULLABLE'] != CRM_Utils_Array::value('IS_NULLABLE', $logTableSpecs[$col]) && $logTableSpecs[$col]['IS_NULLABLE'] == 'NO') { // if is-null property is different, and log table's column is NOT-NULL, surely consider the column $diff['MODIFY'][] = $col; - } else if ($civiTableSpecs[$col]['COLUMN_DEFAULT'] != CRM_Utils_Array::value('COLUMN_DEFAULT', $logTableSpecs[$col]) && + } + else if ($civiTableSpecs[$col]['COLUMN_DEFAULT'] != CRM_Utils_Array::value('COLUMN_DEFAULT', $logTableSpecs[$col]) && !strstr($civiTableSpecs[$col]['COLUMN_DEFAULT'], 'TIMESTAMP')) { // if default property is different, and its not about a timestamp column, consider it $diff['MODIFY'][] = $col; diff --git a/CRM/Mailing/Info.php b/CRM/Mailing/Info.php index cf73eff420..cb954343e7 100644 --- a/CRM/Mailing/Info.php +++ b/CRM/Mailing/Info.php @@ -91,7 +91,8 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info { 'return' => array("msg_html", "id", "msg_title", "msg_subject"), 'id' => array('>' => 58), )); - } else { + } + else { // CiviMail UI $emailAdd = civicrm_api3('Email', 'get', array( 'sequential' => 1, diff --git a/CRM/Mailing/Selector/Browse.php b/CRM/Mailing/Selector/Browse.php index 2ca4af7abc..b973623dda 100644 --- a/CRM/Mailing/Selector/Browse.php +++ b/CRM/Mailing/Selector/Browse.php @@ -535,7 +535,8 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul if (isset($isArchived)) { if ($isArchived) { $clauses[] = "civicrm_mailing.is_archived = 1"; - } else { + } + else { $clauses[] = "(civicrm_mailing.is_archived IS NULL OR civicrm_mailing.is_archived = 0)"; } } diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 062be223da..9eb1d699b7 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -526,7 +526,8 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { $month = substr($membershipTypeDetails['fixed_period_start_day'], 0, strlen($membershipTypeDetails['fixed_period_start_day']) - 2); $day = substr($membershipTypeDetails['fixed_period_start_day'], -2); $year += 1; - } else { + } + else { $year = $year + ($numRenewTerms * $membershipTypeDetails['duration_interval']); } break; diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index f7ea549083..7a46b74d10 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -1599,7 +1599,8 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; if (isset($value['tax_amount']) && isset($value['tax_rate'])) { if (isset($dataArray[$value['tax_rate']])) { $dataArray[$value['tax_rate']] = $dataArray[$value['tax_rate']] + CRM_Utils_Array::value('tax_amount', $value); - } else { + } + else { $dataArray[$value['tax_rate']] = CRM_Utils_Array::value('tax_amount', $value); } } diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 1addb243d3..b5eb6244a1 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -319,7 +319,8 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { if ( $customFields[$customFieldID]['data_type'] == 'Date' ) { CRM_Contact_Import_Parser_Contact::formatCustomDate($params, $formatted, $dateType, $key); unset($params[$key]); - } else if ( $customFields[$customFieldID]['data_type'] == 'Boolean' ) { + } + else if ( $customFields[$customFieldID]['data_type'] == 'Boolean' ) { $params[$key] = CRM_Utils_String::strtoboolstr($val); } } @@ -658,7 +659,8 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { ( strtolower($customValue) == strtolower(trim($v1)) )) { if ( $type == 'CheckBox' ) { $values[$key][$customValue] = 1; - } else { + } + else { $values[$key][] = $customValue; } } diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index b98e8e99ba..710a7b3ab0 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -148,14 +148,16 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { if (CRM_Utils_Array::value( $index, CRM_Utils_Array::value('option_financial_type_id', $params))) { $options['financial_type_id'] = $params['option_financial_type_id'][$index]; - } elseif (!empty($params['financial_type_id'])) { + } + elseif (!empty($params['financial_type_id'])) { $options['financial_type_id'] = $params['financial_type_id']; } if ($opIds = CRM_Utils_Array::value('option_id', $params)) { if ($opId = CRM_Utils_Array::value($index, $opIds)) { $optionsIds['id'] = $opId; - } else { + } + else { $optionsIds['id'] = NULL; } } @@ -761,7 +763,8 @@ WHERE id IN (" . implode(',', array_keys($priceFields)) . ')'; if (empty($noneSelectedPriceFields)) { $error['_qf_default'] = ts('Please select at least one option from price set.'); } - } else { + } + else { $error['_qf_default'] = ts('Please select at least one option from price set.'); } } diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 95c44a49dc..02430fc25f 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -309,7 +309,8 @@ class CRM_Profile_Form extends CRM_Core_Form { if ($this->_multiRecord) { if ($this->_multiRecord != CRM_Core_Action::ADD) { $this->_recordId = CRM_Utils_Request::retrieve('recordId', 'Positive', $this); - } else { + } + else { $this->_recordId = NULL; $this->set('recordId', NULL); } @@ -319,7 +320,8 @@ class CRM_Profile_Form extends CRM_Core_Form { CRM_Core_Error::fatal(ts('The requested Profile (gid=%1) requires record id while performing this action', array(1 => $this->_gid) )); - } elseif (empty($this->_multiRecordFields)) { + } + elseif (empty($this->_multiRecordFields)) { CRM_Core_Error::fatal(ts('No Multi-Record Fields configured for this profile (gid=%1)', array(1 => $this->_gid) )); @@ -339,7 +341,8 @@ class CRM_Profile_Form extends CRM_Core_Form { if (array_key_exists($this->_recordId, $getValues)) { $this->_recordExists = TRUE; - } else { + } + else { $this->_recordExists = FALSE; if ($this->_multiRecord & CRM_Core_Action::UPDATE) { CRM_Core_Session::setStatus(ts('Note: The record %1 doesnot exists. Upon save a new record will be create', array(1 => $this->_recordId)), ts('Record doesnot exist'), 'alert'); @@ -353,7 +356,8 @@ class CRM_Profile_Form extends CRM_Core_Form { } } - } elseif (!empty($this->_multiRecordFields) + } + elseif (!empty($this->_multiRecordFields) && (!$this->_multiRecord || !in_array($this->_multiRecord, array(CRM_Core_Action::DELETE, CRM_Core_Action::UPDATE)) )) { CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header'); //multirecord listing page @@ -391,7 +395,8 @@ class CRM_Profile_Form extends CRM_Core_Form { if ($this->_multiRecord && !empty($this->_multiRecordFields)) { $this->_fields = $this->_multiRecordFields; $this->_multiRecordProfile = TRUE; - } elseif ($this->_multiRecord && empty($this->_multiRecordFields)) { + } + elseif ($this->_multiRecord && empty($this->_multiRecordFields)) { CRM_Core_Session::setStatus(ts('This feature is not currently available.'), ts('Sorry'), 'error'); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm', 'reset=1')); } @@ -454,7 +459,8 @@ class CRM_Profile_Form extends CRM_Core_Form { $defaultValues = CRM_Core_BAO_CustomValueTable::getEntityValues($this->_id, NULL, $fieldIds, TRUE); if ($this->_recordExists == TRUE) { $defaultValues = $defaultValues[$this->_recordId]; - } else { + } + else { $defaultValues = NULL; } } @@ -472,7 +478,8 @@ class CRM_Profile_Form extends CRM_Core_Form { $this->_mode, $value ); - } else { + } + else { $this->_defaults[$name] = ""; } } diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php index 6fa5ec876e..de77131b0d 100644 --- a/CRM/Profile/Form/Edit.php +++ b/CRM/Profile/Form/Edit.php @@ -153,7 +153,8 @@ SELECT module,is_reserved if ($this->_multiRecord && $this->_customGroupTitle) { $groupTitle = ($this->_multiRecord & CRM_Core_Action::UPDATE) ? 'Edit ' . $this->_customGroupTitle . ' Record' : $this->_customGroupTitle; - } else { + } + else { $groupTitle = $this->_ufGroup['title']; } CRM_Utils_System::setTitle($groupTitle); diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index 89f437366b..90d10a41e5 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -300,7 +300,8 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { $copyFields = $fields; CRM_Core_BAO_UFGroup::shiftMultiRecordFields($copyFields, $multiRecordFields); $fieldKey = key($multiRecordFields); - } else { + } + else { $fieldKey = key($fields); } if ($fieldID = CRM_Core_BAO_CustomField::getKeyID($fieldKey)) { @@ -354,7 +355,8 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { $fieldId = CRM_Core_BAO_CustomField::getKeyID($fieldDetail['name']); $customGroupDetails = CRM_Core_BAO_CustomGroup::getGroupTitles(array($fieldId)); $multiRecTitle = $customGroupDetails[$fieldId]['groupTitle']; - } else { + } + else { $title = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $this->_gid, 'title'); } diff --git a/CRM/Queue/Runner.php b/CRM/Queue/Runner.php index 3c88e2fef0..1f694b677a 100644 --- a/CRM/Queue/Runner.php +++ b/CRM/Queue/Runner.php @@ -214,7 +214,8 @@ class CRM_Queue_Runner { if (!$isOK) { $exception = new Exception('Task returned false'); } - } catch (Exception$e) { + } + catch (Exception$e) { $isOK = FALSE; $exception = $e; } diff --git a/CRM/Report/BAO/ReportInstance.php b/CRM/Report/BAO/ReportInstance.php index 2c922ec227..dcf7f94f49 100644 --- a/CRM/Report/BAO/ReportInstance.php +++ b/CRM/Report/BAO/ReportInstance.php @@ -98,9 +98,11 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { if (! $instanceID) { if ($reportID = CRM_Utils_Array::value('report_id', $params)) { $instance->report_id = $reportID; - } else if ($instanceID) { + } + else if ($instanceID) { $instance->report_id = CRM_Report_Utils_Report::getValueFromUrl($instanceID); - } else { + } + else { // just take it from current url $instance->report_id = CRM_Report_Utils_Report::getValueFromUrl(); } diff --git a/CRM/Report/Form/Event/Income.php b/CRM/Report/Form/Event/Income.php index 6dfcf0ef1d..e0c33d31cf 100644 --- a/CRM/Report/Form/Event/Income.php +++ b/CRM/Report/Form/Event/Income.php @@ -359,7 +359,8 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { $count++; $numRows++; } - } elseif ($this->_params['id_op'] == 'notin') { + } + elseif ($this->_params['id_op'] == 'notin') { $events = CRM_Event_PseudoConstant::event(NULL, NULL, "is_template = 0" ); diff --git a/CRM/Report/Form/Instance.php b/CRM/Report/Form/Instance.php index 983cb89ef9..b3e76d0e41 100644 --- a/CRM/Report/Form/Instance.php +++ b/CRM/Report/Form/Instance.php @@ -314,9 +314,11 @@ class CRM_Report_Form_Instance { if ($instanceID && !$isNew) { // updating existing instance $statusMsg = ts('"%1" report has been updated.', array(1 => $instance->title)); - } elseif ($form->getVar('_id') && $isNew) { + } + elseif ($form->getVar('_id') && $isNew) { $statusMsg = ts('Your report has been successfully copied as "%1". You are currently viewing the new copy.', array(1 => $instance->title)); - } else { + } + else { $statusMsg = ts('"%1" report has been successfully created. You are currently viewing the new report instance.', array(1 => $instance->title)); } CRM_Core_Session::setStatus($statusMsg); diff --git a/CRM/Report/Page/InstanceList.php b/CRM/Report/Page/InstanceList.php index 3d060d456f..1352a22446 100644 --- a/CRM/Report/Page/InstanceList.php +++ b/CRM/Report/Page/InstanceList.php @@ -194,7 +194,8 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { $this->assign('reportUrl', $reportUrl); if ($this->ovID) { $this->assign('title', $this->title); - } else { + } + else { CRM_Utils_System::setTitle(ts('%1 Reports', array(1 => $this->_compName))); } } @@ -203,7 +204,8 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { if ($this->compID) { $newButton = ts('New %1 Report', array(1 => $this->_compName)); $templateUrl = CRM_Utils_System::url('civicrm/report/template/list', "reset=1&compid={$this->compID}"); - } else { + } + else { $newButton = ts('New Report'); $templateUrl = CRM_Utils_System::url('civicrm/report/template/list', "reset=1"); } diff --git a/CRM/Report/Page/TemplateList.php b/CRM/Report/Page/TemplateList.php index 934571e64c..653e7c50d2 100644 --- a/CRM/Report/Page/TemplateList.php +++ b/CRM/Report/Page/TemplateList.php @@ -54,7 +54,8 @@ class CRM_Report_Page_TemplateList extends CRM_Core_Page { if ($compID) { if ($compID == 99) { $compClause = " AND v.component_id IS NULL "; - } else { + } + else { $compClause = " AND v.component_id = {$compID} "; } } diff --git a/CRM/SMS/Page/Callback.php b/CRM/SMS/Page/Callback.php index 83a202a285..015fef0a6a 100644 --- a/CRM/SMS/Page/Callback.php +++ b/CRM/SMS/Page/Callback.php @@ -41,7 +41,8 @@ class CRM_SMS_Page_Callback if (array_key_exists('status',$_REQUEST)){ $provider->callback(); - } else { + } + else { $provider->inbound(); } } diff --git a/CRM/SMS/Provider.php b/CRM/SMS/Provider.php index aaf681e457..c6f6e5c89c 100644 --- a/CRM/SMS/Provider.php +++ b/CRM/SMS/Provider.php @@ -79,7 +79,8 @@ abstract class CRM_SMS_Provider { if ($ext->isExtensionKey($providerName)) { $paymentClass = $ext->keyToClass($providerName); require_once "{$paymentClass}.php"; - } else { + } + else { CRM_Core_Error::fatal("Could not locate extension for {$providerName}."); } diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index bc5faa7d22..78bb47fa42 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -686,7 +686,8 @@ SET version = '$version' $postUpgradeMessage = file_get_contents($postUpgradeMessageFile); $versionObject->setPostUpgradeMessage($postUpgradeMessage, $rev); file_put_contents($postUpgradeMessageFile, $postUpgradeMessage); - } else { + } + else { $postUpgradeMessage = file_get_contents($postUpgradeMessageFile); CRM_Upgrade_Incremental_Legacy::setPostUpgradeMessage($postUpgradeMessage, $rev); file_put_contents($postUpgradeMessageFile, $postUpgradeMessage); diff --git a/CRM/Upgrade/Incremental/Legacy.php b/CRM/Upgrade/Incremental/Legacy.php index 08d16de2f9..87ca1f4c13 100644 --- a/CRM/Upgrade/Incremental/Legacy.php +++ b/CRM/Upgrade/Incremental/Legacy.php @@ -105,7 +105,8 @@ SELECT id $preUpgradeMessage .= '
' . ts('This system included an outdated, insecure script (%1). The file was automatically deleted.', array( 1 => $ofcFile )); - } else { + } + else { $preUpgradeMessage .= '
' . ts('This system includes an outdated, insecure script (%1). Please delete it.', array( 1 => $ofcFile )); diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php index 619dd36183..78a354322a 100644 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ b/CRM/Upgrade/Incremental/php/FourThree.php @@ -909,7 +909,8 @@ AND TABLE_SCHEMA = %1 if ($value['tableName'] == 'civicrm_membership_type' || $value['tableName'] == 'civicrm_contribution_recur') { $foreignKeyExists = CRM_Core_DAO::checkConstraintExists($value['tableName'], $value['fkey']); $fKey = $value['fkey']; - } else { + } + else { $foreignKeyExists = CRM_Core_DAO::checkFKConstraintInFormat($value['tableName'], $columnName); $fKey = "`FK_{$value['tableName']}_{$columnName}`"; } diff --git a/CRM/Upgrade/Incremental/php/FourTwo.php b/CRM/Upgrade/Incremental/php/FourTwo.php index c03f54d178..6fb33ae416 100644 --- a/CRM/Upgrade/Incremental/php/FourTwo.php +++ b/CRM/Upgrade/Incremental/php/FourTwo.php @@ -110,9 +110,11 @@ ORDER BY mp.contribution_id, mp.membership_id"; $preUpgradeMessage .= '
' . ts('Could not determine path to civicrm.settings.php. Please manually locate it and add these lines at the bottom:
%1
', array( 1 => self::SETTINGS_SNIPPET )); - } elseif (preg_match(self::SETTINGS_SNIPPET_PATTERN, file_get_contents(CIVICRM_SETTINGS_PATH))) { + } + elseif (preg_match(self::SETTINGS_SNIPPET_PATTERN, file_get_contents(CIVICRM_SETTINGS_PATH))) { // OK, nothing to do - } elseif (!is_writable(CIVICRM_SETTINGS_PATH)) { + } + elseif (!is_writable(CIVICRM_SETTINGS_PATH)) { $preUpgradeMessage .= '
' . ts('The settings file (%1) must be updated. Please make it writable or manually add these lines:
%2
', array( 1 => CIVICRM_SETTINGS_PATH, 2 => self::SETTINGS_SNIPPET @@ -198,7 +200,8 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_price_set` DROP INDEX `UI_title_{$locale}`", $params, TRUE, NULL, FALSE, FALSE); } } - } else { + } + else { $query = "SHOW KEYS FROM `civicrm_price_set` WHERE key_name = 'UI_title'"; $dao = CRM_Core_DAO::executeQuery($query); if ($dao->N) { @@ -789,7 +792,8 @@ AND cli.entity_id IS NULL AND cp.fee_amount IS NOT NULL"; 'price_field_value_id' => $dao->price_field_value_id, ); $priceSetId = $dao->price_set_id; - } else { + } + else { $lineParams['price_field_id'] = $fieldID; $priceSetId = $defaultPriceSetId; } @@ -962,7 +966,8 @@ VALUES foreach ( $processedRecords as $record ) { CRM_Core_Error::debug_log_message(implode(', ', $record)); } - } else { + } + else { CRM_Core_Error::debug_log_message("deleteInvalidPairs() - Could not find any records to process."); } return $processedRecords; diff --git a/CRM/Upgrade/Page/Upgrade.php b/CRM/Upgrade/Page/Upgrade.php index d6f9c0d19b..a65a45cf79 100644 --- a/CRM/Upgrade/Page/Upgrade.php +++ b/CRM/Upgrade/Page/Upgrade.php @@ -100,7 +100,8 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page { $config = CRM_Core_Config::singleton(); // also cleanup the templates_c directory $config->cleanupCaches(); - } else { + } + else { $config = CRM_Core_Config::singleton(); // cleanup only the templates_c directory $config->cleanup(1, FALSE); @@ -180,7 +181,8 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page { // This destroys $session, so do it after get('postUpgradeMessageFile') CRM_Upgrade_Form::doFinish(); - } else { + } + else { $postUpgradeMessage = ''; // Session was destroyed! Can't recover messages. } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php index 30a5023992..e7205e95b7 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php @@ -282,7 +282,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p if (property_exists($qf, '_membershipBlock') && !empty($qf->_membershipBlock['is_separate_payment']) && $qf->_quickConfig && $field->name == 'other_amount' && !property_exists($qf, '_contributionAmount')) { $label = ts('Additional Contribution'); $useRequired = 0; - } elseif (!empty($fieldOptions[$optionKey]['label'])) { //check for label. + } + elseif (!empty($fieldOptions[$optionKey]['label'])) { //check for label. $label = $fieldOptions[$optionKey]['label']; } @@ -310,7 +311,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p if (property_exists($qf, '_quickConfig') && $qf->_quickConfig) { $message = ts("Please enter a valid amount."); $type = "money"; - } else { + } + else { $message = ts('%1 must be an integer (whole number).', array(1 => $label)); $type = "positiveInteger"; } @@ -340,7 +342,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p ); if (property_exists($qf, '_quickConfig') && $qf->_quickConfig && $field->name == 'contribution_amount') { $extra += array('onclick' => 'clearAmountOther();'); - } elseif (property_exists($qf, '_quickConfig') && $qf->_quickConfig && $field->name == 'membership_amount') { + } + elseif (property_exists($qf, '_quickConfig') && $qf->_quickConfig && $field->name == 'membership_amount') { $extra += array( 'onclick' => "return showHideAutoRenew({$opt['membership_type_id']});", 'membership-type' => $opt['membership_type_id'], @@ -367,9 +370,11 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p // add "none" option if (!empty($otherAmount['is_allow_other_amount']) && $field->name == 'contribution_amount') { $none = ts('Other Amount'); - } elseif (property_exists($qf, '_membershipBlock') && empty($qf->_membershipBlock['is_required']) && $field->name == 'membership_amount') { + } + elseif (property_exists($qf, '_membershipBlock') && empty($qf->_membershipBlock['is_required']) && $field->name == 'membership_amount') { $none = ts('No thank you'); - } else { + } + else { $none = ts('-none-'); } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php index 5c6b580849..1927415b81 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php @@ -290,7 +290,8 @@ LEFT JOIN civicrm_price_set ps ON ps.id = pf.price_set_id "; $entityName = 'default_contribution_amount'; $where .= " AND ps.name = %4 "; $params[4] = array($entityName, 'String'); - } elseif ($entityTable == 'civicrm_participant') { + } + elseif ($entityTable == 'civicrm_participant') { $from .= " LEFT JOIN civicrm_price_set_entity cpse ON cpse.price_set_id = ps.id LEFT JOIN civicrm_price_field_value cpfv ON cpfv.price_field_id = pf.id and cpfv.label = %4 "; diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php index 211536a2df..38a51720d6 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php @@ -360,7 +360,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO if (!empty($field['import'])) { if ($prefix) { self::$_import['price_field'] = & $fields[$name]; - } else { + } + else { self::$_import[$name] = & $fields[$name]; } } @@ -383,7 +384,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO if (!empty($field['export'])) { if ($prefix) { self::$_export['price_field'] = & $fields[$name]; - } else { + } + else { self::$_export[$name] = & $fields[$name]; } } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php index 321e318566..2fb79f72f9 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php @@ -303,7 +303,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue extends CRM_Core_DAO if (!empty($field['import'])) { if ($prefix) { self::$_import['price_field_value'] = & $fields[$name]; - } else { + } + else { self::$_import[$name] = & $fields[$name]; } } @@ -326,7 +327,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue extends CRM_Core_DAO if (!empty($field['export'])) { if ($prefix) { self::$_export['price_field_value'] = & $fields[$name]; - } else { + } + else { self::$_export[$name] = & $fields[$name]; } } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php index 776852c0b2..ce0b37a6d4 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php @@ -279,7 +279,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem extends CRM_Core_DAO if (!empty($field['import'])) { if ($prefix) { self::$_import['line_item'] = & $fields[$name]; - } else { + } + else { self::$_import[$name] = & $fields[$name]; } } @@ -302,7 +303,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem extends CRM_Core_DAO if (!empty($field['export'])) { if ($prefix) { self::$_export['line_item'] = & $fields[$name]; - } else { + } + else { self::$_export[$name] = & $fields[$name]; } } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php index 0dc46b6bfd..3563fbf250 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php @@ -303,7 +303,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set extends CRM_Core_DAO if (!empty($field['import'])) { if ($prefix) { self::$_import['price_set'] = & $fields[$name]; - } else { + } + else { self::$_import[$name] = & $fields[$name]; } } @@ -326,7 +327,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set extends CRM_Core_DAO if (!empty($field['export'])) { if ($prefix) { self::$_export['price_set'] = & $fields[$name]; - } else { + } + else { self::$_export[$name] = & $fields[$name]; } } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php index 22d70118a9..ec099fabf7 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php @@ -204,7 +204,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity extends CRM_Core_DAO if (!empty($field['import'])) { if ($prefix) { self::$_import['price_set_entity'] = & $fields[$name]; - } else { + } + else { self::$_import[$name] = & $fields[$name]; } } @@ -227,7 +228,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity extends CRM_Core_DAO if (!empty($field['export'])) { if ($prefix) { self::$_export['price_set_entity'] = & $fields[$name]; - } else { + } + else { self::$_export[$name] = & $fields[$name]; } } diff --git a/CRM/Utils/API/HTMLInputCoder.php b/CRM/Utils/API/HTMLInputCoder.php index 7cdc82031f..b6bb130d61 100644 --- a/CRM/Utils/API/HTMLInputCoder.php +++ b/CRM/Utils/API/HTMLInputCoder.php @@ -127,7 +127,8 @@ class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder { foreach ($values as &$value) { $this->encodeInput($value, TRUE); } - } elseif ($castToString || is_string($values)) { + } + elseif ($castToString || is_string($values)) { $values = str_replace(array('<', '>'), array('<', '>'), $values); } } @@ -143,7 +144,8 @@ class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder { foreach ($values as &$value) { $this->decodeOutput($value, TRUE); } - } elseif ($castToString || is_string($values)) { + } + elseif ($castToString || is_string($values)) { $values = str_replace(array('<', '>'), array('<', '>'), $values); } } diff --git a/CRM/Utils/API/NullOutputCoder.php b/CRM/Utils/API/NullOutputCoder.php index 424827db1e..412593e008 100644 --- a/CRM/Utils/API/NullOutputCoder.php +++ b/CRM/Utils/API/NullOutputCoder.php @@ -98,7 +98,8 @@ class CRM_Utils_API_NullOutputCoder extends CRM_Utils_API_AbstractFieldCoder { $lowerAction = strtolower($apiRequest['action']); if ($lowerAction === 'create') { return parent::toApiOutput($apiRequest, $result); - } else { + } + else { return $result; } } diff --git a/CRM/Utils/Array.php b/CRM/Utils/Array.php index 1213096080..2c26507bb6 100644 --- a/CRM/Utils/Array.php +++ b/CRM/Utils/Array.php @@ -570,7 +570,8 @@ class CRM_Utils_Array { foreach ($keys as $key) { if (is_array($record)) { $keyvalue = isset($record[$key]) ? $record[$key] : NULL; - } else { + } + else { $keyvalue = isset($record->{$key}) ? $record->{$key} : NULL; } if (isset($node[$keyvalue]) && !is_array($node[$keyvalue])) { @@ -580,7 +581,8 @@ class CRM_Utils_Array { } if (is_array($record)) { $node[$record[$final_key]] = $record; - } else { + } + else { $node[$record->{$final_key}] = $record; } } @@ -604,7 +606,8 @@ class CRM_Utils_Array { foreach ($records as $key => $record) { if (is_object($record)) { $result[$key] = $record->{$prop}; - } else { + } + else { $result[$key] = $record[$prop]; } } diff --git a/CRM/Utils/Cache/SqlGroup.php b/CRM/Utils/Cache/SqlGroup.php index eefa9cd867..62a76d89ab 100644 --- a/CRM/Utils/Cache/SqlGroup.php +++ b/CRM/Utils/Cache/SqlGroup.php @@ -72,12 +72,14 @@ class CRM_Utils_Cache_SqlGroup implements CRM_Utils_Cache_Interface { public function __construct($config) { if (isset($config['group'])) { $this->group = $config['group']; - } else { + } + else { throw new RuntimeException("Cannot construct SqlGroup cache: missing group"); } if (isset($config['componentID'])) { $this->componentID = $config['componentID']; - } else { + } + else { $this->componentID = NULL; } $this->frontCache = array(); diff --git a/CRM/Utils/Constant.php b/CRM/Utils/Constant.php index 8a4164631b..05c68bf7d6 100644 --- a/CRM/Utils/Constant.php +++ b/CRM/Utils/Constant.php @@ -43,7 +43,8 @@ class CRM_Utils_Constant { public static function value($name, $default = NULL) { if (defined($name)) { return constant($name); - } else { + } + else { return $default; } } diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index 1041f29715..5e50e8b813 100644 --- a/CRM/Utils/DeprecatedUtils.php +++ b/CRM/Utils/DeprecatedUtils.php @@ -292,7 +292,8 @@ function _civicrm_api3_deprecated_formatted_param($params, &$values, $create = F ); if (!isset($svq)) { return civicrm_api3_create_error("Invalid Contact ID: There is no contact record with contact_id = $value."); - } else if ($svq == 1) { + } + else if ($svq == 1) { return civicrm_api3_create_error("Invalid Contact ID: contact_id $value is a soft-deleted contact."); } @@ -1075,7 +1076,8 @@ function _civicrm_api3_deprecated_add_formatted_location_blocks(&$values, &$para ( strtolower( $v2['value'] ) == strtolower( trim( $v1 ) ) ) ) { if ( $htmlType == 'CheckBox' ) { $newValues[$key][$v2['value']] = 1; - } else { + } + else { $newValues[$key][] = $v2['value']; } } diff --git a/CRM/Utils/FakeObject.php b/CRM/Utils/FakeObject.php index c7fa4d7cae..a38f6f7fb7 100644 --- a/CRM/Utils/FakeObject.php +++ b/CRM/Utils/FakeObject.php @@ -28,7 +28,8 @@ class CRM_Utils_FakeObject { public function __call($name, $arguments) { if (isset($this->array[$name]) && is_callable($this->array[$name])) { return call_user_func_array($this->array[$name], $arguments); - } else { + } + else { throw new Exception("Call to unimplemented method: $name"); } } diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index c9bed292ae..9be565ecc8 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -558,7 +558,8 @@ HTACCESS; public static function relativize($directory, $basePath) { if (substr($directory, 0, strlen($basePath)) == $basePath) { return substr($directory, strlen($basePath)); - } else { + } + else { return $directory; } } @@ -629,7 +630,8 @@ HTACCESS; $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry{0} == '.') { // ignore - } elseif (is_dir($path)) { + } + elseif (is_dir($path)) { $todos[] = $path; } } @@ -663,7 +665,8 @@ HTACCESS; } if (empty($childParts)) { return FALSE; // same directory - } else { + } + else { return TRUE; } } diff --git a/CRM/Utils/GlobalStack.php b/CRM/Utils/GlobalStack.php index 102fd034de..571e2e919d 100644 --- a/CRM/Utils/GlobalStack.php +++ b/CRM/Utils/GlobalStack.php @@ -88,7 +88,8 @@ class CRM_Utils_GlobalStack { foreach ($values as $key => $value) { $frame[$globalKey][$key] = CRM_Utils_Array::value($key, $GLOBALS[$globalKey]); } - } else { + } + else { $frame[$globalKey] = CRM_Utils_Array::value($globalKey, $GLOBALS); } } @@ -104,7 +105,8 @@ class CRM_Utils_GlobalStack { foreach ($values as $key => $value) { $GLOBALS[$globalKey][$key] = $value; } - } else { + } + else { $GLOBALS[$globalKey] = $values; } } diff --git a/CRM/Utils/Network.php b/CRM/Utils/Network.php index 2a4ddd6838..791816d1a5 100644 --- a/CRM/Utils/Network.php +++ b/CRM/Utils/Network.php @@ -78,7 +78,8 @@ class CRM_Utils_Network { error_reporting($old_error_reporting); return TRUE; } - } catch (Exception $e) { + } + catch (Exception $e) { } error_reporting($old_error_reporting); return FALSE; diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 65068dd243..6860d05f7b 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -295,7 +295,8 @@ class CRM_Utils_REST { if ($args[1] == 'ping') { return self::ping(); } - } else { + } + else { // or the new format (entity+action) $args = array(); $args[0] = 'civicrm'; @@ -512,7 +513,8 @@ class CRM_Utils_REST { return CRM_Utils_System::theme($content); - } else { + } + else { $content = "\n"; CRM_Utils_System::appendTPLFile( $tpl, $content ); echo $content . $smarty->fetch($tpl); diff --git a/CRM/Utils/Signer.php b/CRM/Utils/Signer.php index 53eef4721b..e01e62cea1 100644 --- a/CRM/Utils/Signer.php +++ b/CRM/Utils/Signer.php @@ -88,7 +88,8 @@ class CRM_Utils_Signer { $message['payload'] = array(); if (empty($salt)) { $message['salt'] = $this->createSalt(); - } else { + } + else { $message['salt'] = $salt; } // recall: paramNames is pre-sorted for stability @@ -97,7 +98,8 @@ class CRM_Utils_Signer { if (is_numeric($params[$paramName])) { $params[$paramName] = (string) $params[$paramName]; } - } else { // $paramName is not included or ===NULL + } + else { // $paramName is not included or ===NULL $params[$paramName] = ''; } $message['payload'][$paramName] = $params[$paramName]; diff --git a/CRM/Utils/Sort.php b/CRM/Utils/Sort.php index 0ad600d4bd..dfc53770b7 100644 --- a/CRM/Utils/Sort.php +++ b/CRM/Utils/Sort.php @@ -290,7 +290,8 @@ class CRM_Utils_Sort { if (isset($a[$attribute]) && isset($b[$attribute])) { if ($a[$attribute] < $b[$attribute]) { return -1; - } elseif ($a[$attribute] > $b[$attribute]) { + } + elseif ($a[$attribute] > $b[$attribute]) { return 1; } // else: $a and $b are equal wrt to this attribute, try next... } diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index da938cb2c1..015af31dd0 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -1284,7 +1284,8 @@ class CRM_Utils_System { if (!function_exists('ts')) { if ($resource == 'wiki') { $docBaseURL = self::getWikiBaseURL(); - } else { + } + else { $docBaseURL = self::getDocBaseURL(); } return $docBaseURL . str_replace(' ', '+', $page); @@ -1321,7 +1322,8 @@ class CRM_Utils_System { if (CRM_Utils_Array::value('resource', $params) == 'wiki') { $docBaseURL = self::getWikiBaseURL(); - } else { + } + else { $docBaseURL = self::getDocBaseURL(); } diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index 7833c465a0..409b70fcee 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -993,7 +993,8 @@ AND u.status = 1 // TODO: Find a more solid way to make this test // Also, since we don't know how to get the entity type of the group, we'll assume it's 'node' og_ungroup('node', $ogID, 'user', user_load($drupalID)); - } else { + } + else { // Works for the OG 7.x-1.x branch og_ungroup($ogID, 'user', user_load($drupalID)); } @@ -1007,7 +1008,8 @@ AND u.status = 1 global $user; if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) { $timezone = $user->timezone; - } else { + } + else { $timezone = variable_get('date_default_timezone', NULL); } if (!$timezone) { diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index 5a6238eb96..6f8d2b82fd 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -957,7 +957,8 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { global $user; if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) { $timezone = $user->timezone; - } else { + } + else { $timezone = variable_get('date_default_timezone', NULL); } if (!$timezone) { diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index b4ebc51347..03645dadc5 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -565,7 +565,8 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { static $run_once = FALSE; if ($run_once) { return TRUE; - } else { + } + else { $run_once = TRUE; } diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index de314ec906..ffe0b4d1c7 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -404,7 +404,8 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { elseif ($forceBackend) { if (defined('JVERSION')) { $joomlaVersion = JVERSION; - } else { + } + else { $jversion = new JVersion; $joomlaVersion = $jversion->getShortVersion(); } diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 31a003e2ab..e64ecb7c46 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -82,7 +82,8 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { $template->assign('pageTitle', $pageTitle); } - } elseif (civicrm_wp_in_civicrm()) { + } + elseif (civicrm_wp_in_civicrm()) { // legacy pre-4.6 behaviour global $civicrm_wp_title; @@ -478,7 +479,8 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { if (isset($language)) { return CRM_Core_I18n_PseudoConstant::longForShort(substr($language, 0, 2)); - } else { + } + else { return NULL; } } diff --git a/CRM/Utils/XML.php b/CRM/Utils/XML.php index e4c7ffe2df..df9b395aec 100644 --- a/CRM/Utils/XML.php +++ b/CRM/Utils/XML.php @@ -46,7 +46,8 @@ class CRM_Utils_XML { if (! file_exists($file)) { $error = 'File ' . $file . ' does not exist.'; - } else { + } + else { $oldLibXMLErrors = libxml_use_internal_errors(); libxml_use_internal_errors(TRUE); diff --git a/CRM/Utils/Zip.php b/CRM/Utils/Zip.php index d2d8172e82..2499aec9fb 100644 --- a/CRM/Utils/Zip.php +++ b/CRM/Utils/Zip.php @@ -57,7 +57,8 @@ class CRM_Utils_Zip { if (preg_match('/^[^\/]+\/$/', $filename) && $filename != './' && $filename != '../') { $base = $filename; $baselen = strlen($filename); - } else { + } + else { return FALSE; } } elseif (0 != substr_compare($base, $filename, 0, $baselen)) { @@ -103,12 +104,14 @@ class CRM_Utils_Zip { $basedirs = CRM_Utils_Zip::findBaseDirs($zip); if (in_array($expected, $basedirs)) { $candidate = $expected; - } elseif (count($basedirs) == 1) { + } + elseif (count($basedirs) == 1) { $candidate = array_shift($basedirs); } if ($candidate !== FALSE && preg_match('/^[a-zA-Z0-9]/', $candidate)) { return $candidate; - } else { + } + else { return FALSE; } } @@ -141,7 +144,8 @@ class CRM_Utils_Zip { } } $zip->close(); - } else { + } + else { return FALSE; } return TRUE; diff --git a/Civi/CiUtil/Command/CompareCommand.php b/Civi/CiUtil/Command/CompareCommand.php index 78b4dd8a2e..7e603a7a9b 100644 --- a/Civi/CiUtil/Command/CompareCommand.php +++ b/Civi/CiUtil/Command/CompareCommand.php @@ -48,7 +48,8 @@ class CompareCommand { if ($printerType == 'csv') { $printer = new \Civi\CiUtil\CsvPrinter('php://stdout', \Civi\CiUtil\Arrays::collect($suites, 'file')); - } else { + } + else { $printer = new \Civi\CiUtil\ComparisonPrinter(\Civi\CiUtil\Arrays::collect($suites, 'file')); } foreach ($tests as $test) { diff --git a/api/v3/CaseType.php b/api/v3/CaseType.php index d48a60328e..739eb700cd 100644 --- a/api/v3/CaseType.php +++ b/api/v3/CaseType.php @@ -97,7 +97,8 @@ function _civicrm_api3_case_type_get_formatResult(&$result) { $xml = CRM_Case_XMLRepository::singleton()->retrieve($caseTypeName); if ($xml) { $result['values'][$key]['definition'] = CRM_Case_BAO_CaseType::convertXmlToDefinition($xml); - } else { + } + else { $result['values'][$key]['definition'] = array(); } $result['values'][$key]['is_forkable'] = CRM_Case_BAO_CaseType::isForkable($result['values'][$key]['id']); diff --git a/api/v3/Extension.php b/api/v3/Extension.php index c1fa873952..03e56df720 100644 --- a/api/v3/Extension.php +++ b/api/v3/Extension.php @@ -62,7 +62,8 @@ function civicrm_api3_extension_install($params) { try { CRM_Extension_System::singleton()->getManager()->install($keys); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { return civicrm_api3_create_error($e->getMessage()); } @@ -88,13 +89,15 @@ function civicrm_api3_extension_upgrade() { try { $result = $runner->runAll(); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { return civicrm_api3_create_error($e->getMessage()); } if ($result === TRUE) { return civicrm_api3_create_success(); - } else { + } + else { return $result; } } @@ -301,15 +304,19 @@ function civicrm_api3_extension_get($params) { function _civicrm_api3_getKeys($params) { if (array_key_exists('keys', $params) && is_array($params['keys'])) { return $params['keys']; - } elseif (array_key_exists('keys', $params) && is_string($params['keys'])) { + } + elseif (array_key_exists('keys', $params) && is_string($params['keys'])) { if ($params['keys'] == '') { return array(); - } else { + } + else { return explode(API_V3_EXTENSION_DELIMITER, $params['keys']); } - } elseif (array_key_exists('key', $params)) { + } + elseif (array_key_exists('key', $params)) { return array($params['key']); - } else { + } + else { throw new API_Exception('Missing required parameter: key or keys'); } } diff --git a/api/v3/Generic.php b/api/v3/Generic.php index 6140fe80a1..3de180b9ea 100644 --- a/api/v3/Generic.php +++ b/api/v3/Generic.php @@ -116,11 +116,13 @@ function civicrm_api3_generic_getfields($apiRequest) { list ($apiProvider, $hypApiRequest) = \Civi\Core\Container::singleton()->get('civi_api_kernel')->resolve($hypApiRequest); if (isset($hypApiRequest['function'])) { $helper = '_' . $hypApiRequest['function'] . '_spec'; - } else { + } + else { // not implemented MagicFunctionProvider $helper = NULL; } - } catch (\Civi\API\Exception\NotImplementedException $e) { + } + catch (\Civi\API\Exception\NotImplementedException $e) { $helper = NULL; } if (function_exists($helper)) { diff --git a/api/v3/Job.php b/api/v3/Job.php index bdf8a0fff6..4a64c92854 100644 --- a/api/v3/Job.php +++ b/api/v3/Job.php @@ -406,7 +406,8 @@ function civicrm_api3_job_fetch_activities($params) { $values = array( ); $lock->release(); return civicrm_api3_create_success($values, $params,'mailing','activities'); - } catch (Exception $e) { + } + catch (Exception $e) { $lock->release(); return civicrm_api3_create_error('Process Activities failed'); } diff --git a/api/v3/utils.php b/api/v3/utils.php index 67fd1ba35a..9ab3b5e7a8 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -146,7 +146,8 @@ function civicrm_api3_create_error($msg, $data = array()) { // security hole here but seems sensible - perhaps should apply to the trace as well?) if(isset($data['sql']) && CRM_Core_Permission::check('Administer CiviCRM')) { $data['debug_information'] = $data['sql']; // Isn't this redundant? - } else { + } + else { unset($data['sql']); } return $data; @@ -1797,7 +1798,8 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent $realContactId = _civicrm_api3_resolve_contactID($params[$fieldName]); if ('unknown-user' === $realContactId) { throw new API_Exception("\"$fieldName\" \"{$params[$fieldName]}\" cannot be resolved to a contact ID", 2002, array('error_field' => $fieldName, "type" => "integer")); - } elseif (is_numeric($realContactId)) { + } + elseif (is_numeric($realContactId)) { $params[$fieldName] = $realContactId; } } diff --git a/bin/cli.class.php b/bin/cli.class.php index 924e5a0076..1b601581a5 100644 --- a/bin/cli.class.php +++ b/bin/cli.class.php @@ -463,7 +463,8 @@ class civicrm_cli_csv_deleter extends civicrm_cli_csv_file { $result = civicrm_api($this->_entity, 'Delete', $params); if ($result['is_error']) { echo "\nERROR line " . $this->row . ": " . $result['error_message'] . "\n"; - } else { + } + else { echo "\nline " . $this->row . ": deleted\n"; } } diff --git a/install/index.php b/install/index.php index e9cb8757e7..53811c90ea 100644 --- a/install/index.php +++ b/install/index.php @@ -1014,7 +1014,8 @@ class InstallRequirements { if (!$result) { $testDetails[2] = 'Could not query thread_stack.'; $this->error($testDetails); - } else { + } + else { $values = mysql_fetch_row($result); if ($values[1] < (1024 * $minValueKB)) { $testDetails[2] = 'MySQL "thread_stack" is ' . ($values[1] / 1024) . 'k'; diff --git a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php index ee546ab689..309c3571f3 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php @@ -220,7 +220,8 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { $objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly); if (is_array($objects)) { $this->registerTestObjects($objects); - } else { + } + else { $this->registerTestObjects(array($objects)); } return $objects; diff --git a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php index 97649c8019..8c466560c4 100644 --- a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php +++ b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php @@ -906,7 +906,8 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly); if (is_array($objects)) { $this->registerTestObjects($objects); - } else { + } + else { $this->registerTestObjects(array($objects)); } return $objects; diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php index 235351b6a6..932621265f 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php @@ -71,7 +71,8 @@ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase { $message = NULL; try { $result = CRM_Core_BAO_CustomValueTable::setValues($params); - } catch ( Exception $e ) { + } + catch ( Exception $e ) { $message = $e->getMessage(); } $errorScope = NULL; @@ -172,7 +173,8 @@ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase { $message = NULL; try { $result = CRM_Core_BAO_CustomValueTable::setValues($params); - } catch (Exception $e) { + } + catch (Exception $e) { $message = $e->getMessage(); } $errorScope = NULL; diff --git a/tests/phpunit/CRM/Core/InnoDBIndexerTest.php b/tests/phpunit/CRM/Core/InnoDBIndexerTest.php index c4d67df5cb..7d744672e7 100644 --- a/tests/phpunit/CRM/Core/InnoDBIndexerTest.php +++ b/tests/phpunit/CRM/Core/InnoDBIndexerTest.php @@ -53,7 +53,8 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { try { CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_contact WHERE MATCH(first_name,last_name) AGAINST ("joe")'); $this->fail("Missed expected exception"); - } catch (Exception $e) { + } + catch (Exception $e) { $this->assertTrue(TRUE, 'Received expected exception'); } } diff --git a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php index b65cc2f6e6..943774fd06 100644 --- a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php +++ b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php @@ -271,7 +271,8 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { try { $me->reconcile(); $this->fail('Expected exception when using invalid declaration'); - } catch (Exception $e) { + } + catch (Exception $e) { // good } } @@ -296,7 +297,8 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { try { $me->reconcile(); $this->fail('Expected exception when using invalid declaration'); - } catch (Exception $e) { + } + catch (Exception $e) { // good } } @@ -321,7 +323,8 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { try { $me->reconcile(); $this->fail('Expected exception when using invalid declaration'); - } catch (Exception $e) { + } + catch (Exception $e) { // good } } diff --git a/tests/phpunit/CRM/Core/TransactionTest.php b/tests/phpunit/CRM/Core/TransactionTest.php index 128db9ea2a..a6da28bad3 100644 --- a/tests/phpunit/CRM/Core/TransactionTest.php +++ b/tests/phpunit/CRM/Core/TransactionTest.php @@ -265,7 +265,8 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { $test->assertContactsExistByOffset(array(0 => TRUE)); throw new Exception("Ruh-roh"); }); - } catch (Exception $ex) { + } + catch (Exception $ex) { $e = $ex; if (get_class($e) != 'Exception' || $e->getMessage() != 'Ruh-roh') { throw $e; @@ -332,7 +333,8 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { if ($insert == 'sql-insert') { $r = CRM_Core_DAO::executeQuery("INSERT INTO civicrm_contact(first_name,last_name) VALUES ('ff', 'll')"); $cid = mysql_insert_id(); - } elseif ($insert == 'bao-create') { + } + elseif ($insert == 'bao-create') { $params = array( 'contact_type' => 'Individual', 'first_name' => 'FF', @@ -348,7 +350,8 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { if ($outcome == 'rollback') { $tx->rollback(); - } elseif ($outcome == 'explicit-commit') { + } + elseif ($outcome == 'explicit-commit') { $tx->commit(); } // else: implicit-commit @@ -388,7 +391,8 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { if ($outcome == 'rollback') { $tx->rollback(); - } elseif ($outcome == 'explicit-commit') { + } + elseif ($outcome == 'explicit-commit') { $tx->commit(); } // else: implicit-commit } diff --git a/tests/phpunit/CRM/Extension/Container/BasicTest.php b/tests/phpunit/CRM/Extension/Container/BasicTest.php index db372bf810..acc7191f67 100644 --- a/tests/phpunit/CRM/Extension/Container/BasicTest.php +++ b/tests/phpunit/CRM/Extension/Container/BasicTest.php @@ -29,7 +29,8 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { list($basedir, $c) = $this->_createContainer(); try { $c->getPath('un.kno.wn'); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc), 'Expected exception'); @@ -42,7 +43,8 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { list($basedir, $c) = $this->_createContainer(NULL, NULL, '/'); try { $c->getPath('un.kno.wn'); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc), 'Expected exception'); @@ -55,7 +57,8 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { list($basedir, $c) = $this->_createContainer(); try { $c->getResUrl('un.kno.wn'); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc), 'Expected exception'); @@ -68,7 +71,8 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { list($basedir, $c) = $this->_createContainer(NULL, NULL, '/'); try { $c->getResUrl('un.kno.wn'); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc), 'Expected exception'); diff --git a/tests/phpunit/CRM/Extension/Container/CollectionTest.php b/tests/phpunit/CRM/Extension/Container/CollectionTest.php index 7677e5b45c..df7fe8765e 100644 --- a/tests/phpunit/CRM/Extension/Container/CollectionTest.php +++ b/tests/phpunit/CRM/Extension/Container/CollectionTest.php @@ -56,7 +56,8 @@ class CRM_Extension_Container_CollectionTest extends CiviUnitTestCase { $c = $this->_createContainer(); try { $c->getPath('un.kno.wn'); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc), 'Expected exception'); @@ -72,7 +73,8 @@ class CRM_Extension_Container_CollectionTest extends CiviUnitTestCase { $c = $this->_createContainer(); try { $c->getResUrl('un.kno.wn'); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc), 'Expected exception'); diff --git a/tests/phpunit/CRM/Extension/Container/StaticTest.php b/tests/phpunit/CRM/Extension/Container/StaticTest.php index 4d199b7896..91d57303ad 100644 --- a/tests/phpunit/CRM/Extension/Container/StaticTest.php +++ b/tests/phpunit/CRM/Extension/Container/StaticTest.php @@ -28,7 +28,8 @@ class CRM_Extension_Container_StaticTest extends CiviUnitTestCase { $c = $this->_createContainer(); try { $c->getPath('un.kno.wn'); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc), 'Expected exception'); @@ -41,7 +42,8 @@ class CRM_Extension_Container_StaticTest extends CiviUnitTestCase { $c = $this->_createContainer(); try { $c->getResUrl('un.kno.wn'); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc), 'Expected exception'); diff --git a/tests/phpunit/CRM/Extension/InfoTest.php b/tests/phpunit/CRM/Extension/InfoTest.php index 6ce2aea4cb..96c1d56187 100644 --- a/tests/phpunit/CRM/Extension/InfoTest.php +++ b/tests/phpunit/CRM/Extension/InfoTest.php @@ -36,7 +36,8 @@ class CRM_Extension_InfoTest extends CiviUnitTestCase { $exc = NULL; try { $info = CRM_Extension_Info::loadFromFile($this->file); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc)); @@ -58,7 +59,8 @@ class CRM_Extension_InfoTest extends CiviUnitTestCase { $exc = NULL; try { $info = CRM_Extension_Info::loadFromString($data); - } catch (CRM_Extension_Exception $e) { + } + catch (CRM_Extension_Exception $e) { $exc = $e; } $this->assertTrue(is_object($exc)); diff --git a/tests/phpunit/CRM/Extension/Manager/PaymentTest.php b/tests/phpunit/CRM/Extension/Manager/PaymentTest.php index 1cd0b75b97..1f17bd02c4 100644 --- a/tests/phpunit/CRM/Extension/Manager/PaymentTest.php +++ b/tests/phpunit/CRM/Extension/Manager/PaymentTest.php @@ -121,7 +121,8 @@ class CRM_Extension_Manager_PaymentTest extends CiviUnitTestCase { try { $manager->uninstall(array('test.extension.manager.paymenttest')); $this->fail('Failed to catch expected exception'); - } catch (CRM_Extension_Exception_DependencyException $e) { + } + catch (CRM_Extension_Exception_DependencyException $e) { } $this->assertEquals(0, test_extension_manager_paymenttest::$counts['uninstall']); $this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_payment_processor_type WHERE class_name = "test.extension.manager.paymenttest"'); diff --git a/tests/phpunit/CRM/Utils/SQL/SelectTest.php b/tests/phpunit/CRM/Utils/SQL/SelectTest.php index 20d4fdf460..896a8b880a 100644 --- a/tests/phpunit/CRM/Utils/SQL/SelectTest.php +++ b/tests/phpunit/CRM/Utils/SQL/SelectTest.php @@ -133,7 +133,8 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { '#num' => '5not-a-number5' )); $this->fail('Expected exception; got: ' . var_export($result, TRUE)); - } catch (CRM_Core_Exception $e) { + } + catch (CRM_Core_Exception $e) { $this->assertTrue(TRUE, "Caught expected exception"); } @@ -142,7 +143,8 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { '#num' => array(1, '5not-a-number5', 2) )); $this->fail('Expected exception; got: ' . var_export($result, TRUE)); - } catch (CRM_Core_Exception $e) { + } + catch (CRM_Core_Exception $e) { $this->assertTrue(TRUE, "Caught expected exception"); } } @@ -153,7 +155,8 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { '{var}' => 'not a well-formed variable name' )); $this->fail('Expected exception; got: ' . var_export($result, TRUE)); - } catch (CRM_Core_Exception $e) { + } + catch (CRM_Core_Exception $e) { $this->assertTrue(TRUE, "Caught expected exception"); } } diff --git a/tests/phpunit/CiviTest/CiviReportTestCase.php b/tests/phpunit/CiviTest/CiviReportTestCase.php index 1a1d30c74d..aa2187202f 100644 --- a/tests/phpunit/CiviTest/CiviReportTestCase.php +++ b/tests/phpunit/CiviTest/CiviReportTestCase.php @@ -90,7 +90,8 @@ class CiviReportTestCase extends CiviUnitTestCase { $tmpFile = $this->createTempDir() . CRM_Utils_File::makeFileName('CiviReport.csv'); $csvContent = CRM_Report_Utils_Report::makeCsv($reportObj, $rows); file_put_contents($tmpFile, $csvContent); - } catch (Exception $e) { + } + catch (Exception $e) { // print_r($e->getCause()->getUserInfo()); CRM_Utils_GlobalStack::singleton()->pop(); throw $e; diff --git a/tests/phpunit/CiviTest/civicrm.settings.dist.php b/tests/phpunit/CiviTest/civicrm.settings.dist.php index 0db1e5d69f..fc50cd20c8 100644 --- a/tests/phpunit/CiviTest/civicrm.settings.dist.php +++ b/tests/phpunit/CiviTest/civicrm.settings.dist.php @@ -21,11 +21,13 @@ if (!defined("CIVICRM_DSN")) { $dsn = getenv("CIVICRM_TEST_DSN"); if (!empty ($dsn)) { define("CIVICRM_DSN", $dsn); - } else { + } + else { echo "\nFATAL: no DB connection configured (CIVICRM_DSN). \nYou can either create/edit " . __DIR__ . "/civicrm.settings.local.php\n"; if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { echo "OR set it in your shell:\n \$export CIVICRM_TEST_DSN=mysql://db_username:db_password@localhost/civicrm_tests_dev \n"; - } else { + } + else { echo "OR set it in your shell:\n SETX CIVICRM_TEST_DSN mysql://db_username:db_password@localhost/civicrm_tests_dev \n (you will need to open a new command shell before it takes effect)"; } @@ -69,7 +71,8 @@ if (empty($civicrm_root)) { if (!defined("CIVICRM_TEMPLATE_COMPILEDIR")) { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { define( 'CIVICRM_TEMPLATE_COMPILEDIR', getenv('TMP') . DIRECTORY_SEPARATOR . 'civi' . DIRECTORY_SEPARATOR ); - } else { + } + else { define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/tmp/civi/' ); } } diff --git a/tests/phpunit/EnvTests.php b/tests/phpunit/EnvTests.php index 12de297b65..45b53bd627 100644 --- a/tests/phpunit/EnvTests.php +++ b/tests/phpunit/EnvTests.php @@ -22,7 +22,8 @@ class EnvTests extends \PHPUnit_Framework_TestSuite { list ($class, $method) = explode('::', $test); $clazz = new \ReflectionClass($class); $suite->addTestMethod($clazz, $clazz->getMethod($method)); - } else { + } + else { $suite->addTestSuite($test); } } diff --git a/tests/phpunit/Utils.php b/tests/phpunit/Utils.php index 57eaec47b0..1dd53ab109 100644 --- a/tests/phpunit/Utils.php +++ b/tests/phpunit/Utils.php @@ -111,7 +111,8 @@ class Utils { if ( array_key_exists( 'function', $frame ) ) { echo " method {$frame['function']}"; } - } else { + } + else { if ( array_key_exists( 'function', $frame ) ) { echo " function {$frame['function']}"; } diff --git a/tests/phpunit/WebTest/Mailing/MailingTest.php b/tests/phpunit/WebTest/Mailing/MailingTest.php index 724ee0d96c..d751aeb854 100644 --- a/tests/phpunit/WebTest/Mailing/MailingTest.php +++ b/tests/phpunit/WebTest/Mailing/MailingTest.php @@ -511,7 +511,8 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { $this->open($mailingReportUrl); if ($entity == "report") { $this->clickLink("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$key}']]/descendant::td[3]/span/a[1][text()='Report']"); - } else { + } + else { $this->clickLink("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$key}']]/descendant::td[3]/span/a[2][text()='Advanced Search']"); } $this-> _verifyCriteria($key, $dataToCheck, $entity); @@ -532,7 +533,8 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { continue; } $this->assertTrue($this->isElementPresent("xpath=//form//div[3]/table/tbody//tr/th[contains(text(),'{$key}')]/../td[contains(text(),'{$value}')]"), "Criteria check for {$key} failed for Report for {$summaryInfo}"); - } else { + } + else { $this->assertElementContainsText('page-title', "Advanced Search"); $assertedValue = $this->isElementPresent("xpath=//div[@class='crm-results-block']//div[@class='qill'][contains(text(),'{$key} {$value}')]"); if (!$assertedValue) { diff --git a/tests/phpunit/WebTest/Report/RolePermissionReportTest.php b/tests/phpunit/WebTest/Report/RolePermissionReportTest.php index 1dc6e8f1df..45885ba9a4 100644 --- a/tests/phpunit/WebTest/Report/RolePermissionReportTest.php +++ b/tests/phpunit/WebTest/Report/RolePermissionReportTest.php @@ -166,7 +166,8 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase { if ($this->isChecked("edit-2-administer-reserved-reports")) { $this->click("edit-2-administer-reserved-reports"); - } else { + } + else { $this->click("edit-{$roleId}-administer-reserved-reports"); } $this->click("edit-submit"); diff --git a/tests/phpunit/api/v3/APIStandardsTest.php b/tests/phpunit/api/v3/APIStandardsTest.php index ea364ba65b..0f34e98c71 100644 --- a/tests/phpunit/api/v3/APIStandardsTest.php +++ b/tests/phpunit/api/v3/APIStandardsTest.php @@ -114,7 +114,8 @@ class api_v3_APIStandardsTest extends CiviUnitTestCase { } try { $result = $function($params); - } catch ( Exception $e ) { + } + catch ( Exception $e ) { continue; } diff --git a/tests/phpunit/api/v3/UtilsTest.php b/tests/phpunit/api/v3/UtilsTest.php index 4276ed4d3e..48ce8686fa 100644 --- a/tests/phpunit/api/v3/UtilsTest.php +++ b/tests/phpunit/api/v3/UtilsTest.php @@ -117,11 +117,13 @@ class api_v3_UtilsTest extends CiviUnitTestCase { try { $kernel->authorize(NULL, $apiRequest); return TRUE; - } catch (\API_Exception $e) { + } + catch (\API_Exception $e) { $extra = $e->getExtraParams(); if (!$throws && $extra['error_code'] == API_Exception::UNAUTHORIZED) { return FALSE; - } else { + } + else { throw $e; } } -- 2.25.1