From 5e794c90b9c3132f9e792b513e9434721d825712 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 15 Sep 2022 19:14:36 -0400 Subject: [PATCH] Replace CRM_Core_Exception aliases - CRM dir --- CRM/ACL/Form/EntityRole.php | 2 +- CRM/Activity/BAO/Activity.php | 7 ++- CRM/Activity/BAO/Query.php | 3 +- CRM/Activity/Form/Activity.php | 3 +- CRM/Activity/Form/ActivityLinks.php | 2 +- CRM/Activity/Form/Search.php | 6 +-- CRM/Activity/Import/Parser/Activity.php | 2 +- CRM/Admin/Form/Generic.php | 2 +- CRM/Admin/Form/Job.php | 2 +- CRM/Admin/Form/MessageTemplates.php | 2 - CRM/Admin/Form/PaymentProcessor.php | 3 +- CRM/Admin/Form/Preferences.php | 2 +- CRM/Admin/Form/Preferences/Contribute.php | 1 - CRM/Admin/Form/ScheduleReminders.php | 4 +- CRM/Admin/Form/Setting.php | 2 +- CRM/Admin/Form/SettingTrait.php | 6 +-- CRM/Admin/Page/PaymentProcessor.php | 4 +- CRM/Batch/Form/Batch.php | 2 +- CRM/Batch/Form/Entry.php | 10 +---- CRM/Case/BAO/Case.php | 19 ++++---- CRM/Case/Form/Activity/OpenCase.php | 5 +-- CRM/Case/Form/ActivityToCase.php | 1 - CRM/Case/Form/CustomData.php | 2 +- CRM/Case/Form/Search.php | 2 +- CRM/Case/Page/AJAX.php | 2 +- CRM/Contact/BAO/Contact.php | 5 +-- CRM/Contact/BAO/Contact/Utils.php | 6 +-- CRM/Contact/BAO/ContactType.php | 18 ++++---- CRM/Contact/BAO/GroupContact.php | 2 +- CRM/Contact/BAO/GroupContactCache.php | 12 +---- CRM/Contact/BAO/Relationship.php | 23 ++++------ CRM/Contact/BAO/RelationshipType.php | 6 +-- CRM/Contact/BAO/SavedSearch.php | 4 +- CRM/Contact/Form/Domain.php | 2 +- CRM/Contact/Form/Edit/Address.php | 3 +- CRM/Contact/Form/Relationship.php | 4 +- CRM/Contact/Form/Search.php | 2 +- CRM/Contact/Form/Search/Criteria.php | 15 +++---- CRM/Contact/Form/Task/Delete.php | 2 +- CRM/Contact/Form/Task/Email.php | 1 - CRM/Contact/Form/Task/EmailCommon.php | 2 +- CRM/Contact/Form/Task/EmailTrait.php | 23 +++------- CRM/Contact/Form/Task/PDFLetterCommon.php | 2 - CRM/Contact/Form/Task/PDFTrait.php | 4 -- CRM/Contact/Import/Form/DataSource.php | 1 - CRM/Contact/Import/Form/MapField.php | 3 -- CRM/Contact/Import/Form/Preview.php | 2 +- CRM/Contact/Import/Form/Summary.php | 2 - CRM/Contact/Import/Parser/Contact.php | 41 +++++++---------- CRM/Contact/Page/AJAX.php | 4 +- CRM/Contact/Page/DedupeMerge.php | 2 - CRM/Contact/Page/View.php | 2 +- CRM/Contact/Page/View/Relationship.php | 1 - CRM/Contact/Page/View/Summary.php | 4 +- CRM/Contribute/BAO/Contribution.php | 36 +++++---------- CRM/Contribute/BAO/ContributionPage.php | 2 +- CRM/Contribute/BAO/ContributionRecur.php | 19 ++++---- CRM/Contribute/BAO/ContributionSoft.php | 7 +-- CRM/Contribute/BAO/Query.php | 5 +-- .../Exception/CheckLineItemsException.php | 2 +- CRM/Contribute/Form/AbstractEditPayment.php | 1 - CRM/Contribute/Form/AdditionalPayment.php | 6 +-- CRM/Contribute/Form/CancelSubscription.php | 3 +- CRM/Contribute/Form/Contribution.php | 16 +++---- CRM/Contribute/Form/Contribution/Confirm.php | 28 +++++------- CRM/Contribute/Form/Contribution/Main.php | 7 ++- CRM/Contribute/Form/Contribution/ThankYou.php | 3 +- CRM/Contribute/Form/ContributionBase.php | 5 +-- CRM/Contribute/Form/ContributionView.php | 5 +-- CRM/Contribute/Form/ManagePremiums.php | 2 +- CRM/Contribute/Form/Search.php | 4 +- CRM/Contribute/Form/Task/Email.php | 1 - CRM/Contribute/Form/Task/Invoice.php | 2 +- CRM/Contribute/Form/Task/PDF.php | 2 +- CRM/Contribute/Form/Task/PDFLetter.php | 3 +- CRM/Contribute/Form/UpdateSubscription.php | 1 - CRM/Contribute/Import/Form/MapField.php | 2 +- CRM/Contribute/Import/Parser/Contribution.php | 9 ++-- CRM/Contribute/Page/Tab.php | 4 -- CRM/Contribute/Page/Widget.php | 1 - .../Contribution/BasicContribution.php | 8 ++-- CRM/Core/BAO/ActionSchedule.php | 2 - CRM/Core/BAO/Address.php | 2 +- CRM/Core/BAO/Block.php | 8 ++-- CRM/Core/BAO/CustomField.php | 10 ++--- CRM/Core/BAO/CustomGroup.php | 3 +- CRM/Core/BAO/Dashboard.php | 2 +- CRM/Core/BAO/Domain.php | 2 +- CRM/Core/BAO/Email.php | 2 +- CRM/Core/BAO/IM.php | 2 - CRM/Core/BAO/Mapping.php | 6 +-- CRM/Core/BAO/MessageTemplate.php | 6 +-- CRM/Core/BAO/OpenID.php | 2 - CRM/Core/BAO/OptionValue.php | 1 - CRM/Core/BAO/Phone.php | 2 - CRM/Core/BAO/PrevNextCache.php | 1 - CRM/Core/BAO/Setting.php | 14 +++--- CRM/Core/BAO/Tag.php | 2 +- CRM/Core/BAO/UFField.php | 8 ++-- CRM/Core/BAO/UFGroup.php | 2 +- CRM/Core/CodeGen/GenerateData.php | 4 +- CRM/Core/Controller/Task.php | 1 - CRM/Core/DAO.php | 4 +- CRM/Core/DynamicFKAccessTrait.php | 2 +- CRM/Core/EntityTokens.php | 6 +-- CRM/Core/Form.php | 2 +- CRM/Core/Form/RecurringEntity.php | 2 +- CRM/Core/Form/Search.php | 11 +++-- CRM/Core/Form/Task/PDFLetterCommon.php | 1 - CRM/Core/ManagedEntities.php | 4 +- CRM/Core/Page.php | 2 +- CRM/Core/Payment.php | 4 +- CRM/Core/Payment/AuthorizeNetIPN.php | 6 +-- CRM/Core/Payment/BaseIPN.php | 11 +++-- CRM/Core/Payment/PayPalIPN.php | 6 +-- CRM/Core/Payment/PayPalImpl.php | 1 - CRM/Core/Payment/PayPalProIPN.php | 6 --- CRM/Core/SelectValues.php | 2 +- CRM/Core/Session.php | 2 +- CRM/Custom/Import/Parser/Api.php | 2 +- CRM/Dedupe/BAO/DedupeRule.php | 3 +- CRM/Dedupe/MergeHandler.php | 1 - CRM/Dedupe/Merger.php | 39 +++++----------- CRM/Event/BAO/Event.php | 12 +++-- CRM/Event/BAO/Participant.php | 4 +- CRM/Event/BAO/Query.php | 3 +- CRM/Event/Form/ManageEvent/Delete.php | 1 - CRM/Event/Form/Participant.php | 13 ++---- CRM/Event/Form/ParticipantFeeSelection.php | 1 - CRM/Event/Form/Registration.php | 8 ++-- CRM/Event/Form/Registration/Confirm.php | 2 - CRM/Event/Form/Registration/Register.php | 1 - CRM/Event/Form/Search.php | 4 +- CRM/Event/Form/SelfSvcTransfer.php | 5 +-- CRM/Event/Form/Task.php | 2 +- CRM/Event/Form/Task/Batch.php | 3 -- CRM/Event/Import/Parser/Participant.php | 2 +- CRM/Event/Page/ManageEvent.php | 2 +- CRM/Event/ParticipantTokens.php | 2 +- CRM/Event/Tokens.php | 4 +- CRM/Event/WorkflowMessage/EventExamples.php | 10 ++--- CRM/Export/BAO/ExportProcessor.php | 2 - CRM/Export/Utils.php | 2 +- CRM/Financial/BAO/FinancialType.php | 2 +- CRM/Financial/BAO/FinancialTypeAccount.php | 2 +- CRM/Financial/BAO/Order.php | 44 +++++++++---------- CRM/Financial/BAO/Payment.php | 21 ++++----- CRM/Financial/BAO/PaymentProcessor.php | 7 ++- CRM/Financial/Form/FinancialType.php | 2 +- CRM/Financial/Form/PaymentEdit.php | 6 +-- CRM/Financial/Page/AJAX.php | 2 - CRM/Import/DataSource.php | 27 ++++-------- CRM/Import/DataSource/CSV.php | 1 - CRM/Import/DataSource/SQL.php | 1 - CRM/Import/Form/DataSource.php | 2 - CRM/Import/Form/DataSourceConfig.php | 3 +- CRM/Import/Form/MapField.php | 5 +-- CRM/Import/Form/Preview.php | 1 - CRM/Import/Forms.php | 21 +++------ CRM/Import/ImportProcessor.php | 40 ++++++++--------- CRM/Import/Parser.php | 27 +++++------- CRM/Invoicing/Utils.php | 2 +- CRM/Logging/Differ.php | 2 +- CRM/Logging/Schema.php | 8 ++-- CRM/Mailing/BAO/Mailing.php | 3 +- CRM/Mailing/BAO/Query.php | 4 +- CRM/Mailing/Event/BAO/Unsubscribe.php | 1 - CRM/Mailing/Form/Search.php | 6 +-- CRM/Member/BAO/Membership.php | 22 ++++------ CRM/Member/BAO/MembershipType.php | 8 ++-- CRM/Member/BAO/Query.php | 4 +- CRM/Member/Form.php | 6 +-- CRM/Member/Form/Membership.php | 38 ++++++---------- CRM/Member/Form/MembershipBlock.php | 2 - CRM/Member/Form/MembershipRenewal.php | 4 -- CRM/Member/Form/MembershipType.php | 1 - CRM/Member/Form/MembershipView.php | 1 - CRM/Member/Form/Search.php | 4 +- CRM/Member/Form/Task.php | 2 +- CRM/Member/Form/Task/Batch.php | 2 - CRM/Member/Form/Task/PDFLetter.php | 1 - CRM/Member/Form/Task/PDFLetterCommon.php | 1 - CRM/Member/Import/Parser/Membership.php | 2 +- CRM/Member/Page/Tab.php | 2 +- CRM/Member/Tokens.php | 2 +- CRM/Member/Utils/RelationshipProcessor.php | 4 +- CRM/PCP/BAO/PCP.php | 2 +- CRM/Pledge/BAO/Pledge.php | 2 +- CRM/Pledge/BAO/PledgePayment.php | 4 +- CRM/Pledge/BAO/Query.php | 5 +-- CRM/Pledge/Form/Pledge.php | 2 +- CRM/Pledge/Form/Search.php | 2 +- CRM/Price/BAO/LineItem.php | 7 ++- CRM/Price/BAO/PriceField.php | 1 - CRM/Price/Form/Field.php | 1 - CRM/Profile/Form/Edit.php | 2 - CRM/Profile/Page/Dynamic.php | 2 +- CRM/Queue/BAO/Queue.php | 2 +- CRM/Queue/TaskRunner.php | 6 +-- CRM/Report/Form.php | 2 +- CRM/Report/Form/Contact/LoggingSummary.php | 1 - CRM/Upgrade/Incremental/Base.php | 2 +- CRM/Upgrade/Incremental/MessageTemplates.php | 2 +- CRM/Upgrade/Incremental/php/FiveFifty.php | 3 +- CRM/Upgrade/Incremental/php/FiveFiftyOne.php | 2 +- CRM/Upgrade/Incremental/php/FiveFortyOne.php | 2 +- .../Incremental/php/FiveFortySeven.php | 1 - CRM/Upgrade/Incremental/php/FiveThirty.php | 1 - .../Incremental/php/FiveTwentyFour.php | 2 +- .../Incremental/php/FiveTwentyNine.php | 1 - CRM/Upgrade/Incremental/php/FourSeven.php | 2 +- CRM/Utils/API/MatchOption.php | 6 +-- CRM/Utils/API/ReloadOption.php | 4 +- CRM/Utils/Check/Component.php | 6 +-- .../Check/Component/FinancialTypeAcls.php | 2 +- CRM/Utils/Check/Component/Schema.php | 6 +-- CRM/Utils/Check/Message.php | 2 +- CRM/Utils/OptionBag.php | 4 +- CRM/Utils/SQL/BaseParamQuery.php | 2 +- CRM/Utils/Token.php | 6 +-- 220 files changed, 450 insertions(+), 753 deletions(-) diff --git a/CRM/ACL/Form/EntityRole.php b/CRM/ACL/Form/EntityRole.php index 7eb6b667b0..eb137544ba 100644 --- a/CRM/ACL/Form/EntityRole.php +++ b/CRM/ACL/Form/EntityRole.php @@ -47,7 +47,7 @@ class CRM_ACL_Form_EntityRole extends CRM_Admin_Form { /** * Process the form submission. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function postProcess(): void { CRM_ACL_BAO_Cache::resetCache(); diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 215ac3072f..279cfc2959 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -574,7 +574,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { * * @return array * Relevant data object values of open activities - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getActivities($params) { $activities = []; @@ -1001,7 +1001,6 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { * * @deprecated * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function sendEmail( @@ -1906,7 +1905,7 @@ AND cl.modified_id = c.id * @param int $type * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getStatusesByType($type) { if (!isset(Civi::$statics[__CLASS__][__FUNCTION__])) { @@ -1932,7 +1931,7 @@ AND cl.modified_id = c.id * @param array $activity * * @return bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function isOverdue($activity) { return array_key_exists($activity['status_id'], self::getStatusesByType(self::INCOMPLETE)) && CRM_Utils_Date::overdue($activity['activity_date_time']); diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index d147c9fc6f..3aa0f6acad 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -407,7 +407,7 @@ class CRM_Activity_BAO_Query { /** * Get the metadata for fields to be included on the activity search form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @todo ideally this would be a trait included on the activity search & advanced search * rather than a static function. */ @@ -431,7 +431,6 @@ class CRM_Activity_BAO_Query { * * @param CRM_Core_Form_Search $form * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public static function buildSearchForm(&$form) { diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index ab071e004a..e334ca203b 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -610,7 +610,6 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * Build Quick form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm() { if ($this->_action & (CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) { @@ -886,7 +885,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * @param array $params * * @return array|null - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function postProcess($params = NULL) { if ($this->_action & CRM_Core_Action::DELETE) { diff --git a/CRM/Activity/Form/ActivityLinks.php b/CRM/Activity/Form/ActivityLinks.php index ae43fc4dae..6f2f61aa3a 100644 --- a/CRM/Activity/Form/ActivityLinks.php +++ b/CRM/Activity/Form/ActivityLinks.php @@ -74,7 +74,7 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form { ], ]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { continue; } if (!$phone['api.Contact.getsingle']['do_not_sms'] && $phone['phone']) { diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index 6b3e467266..a8d8e09893 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -70,7 +70,6 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { * Processing needed for buildForm and later. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess(): void { $this->set('searchFormName', 'Search'); @@ -121,7 +120,6 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { * Build the form object. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm(): void { parent::buildQuickForm(); @@ -153,7 +151,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { * The processing consists of using a Selector / Controller framework for getting the * search results. * - * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function postProcess(): void { if ($this->_done) { @@ -316,7 +314,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getEntityMetadata() { return CRM_Activity_BAO_Query::getSearchFieldMetadata(); diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 50fe0d93a2..13f18fca5a 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -156,7 +156,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser { * @param array $values * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getMappedRow(array $values): array { $params = []; diff --git a/CRM/Admin/Form/Generic.php b/CRM/Admin/Form/Generic.php index a44e5a55a7..10e6765c6f 100644 --- a/CRM/Admin/Form/Generic.php +++ b/CRM/Admin/Form/Generic.php @@ -79,7 +79,7 @@ class CRM_Admin_Form_Generic extends CRM_Core_Form { try { $this->saveMetadataDefinedSettings($params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { CRM_Core_Session::setStatus($e->getMessage(), ts('Save Failed'), 'error'); } } diff --git a/CRM/Admin/Form/Job.php b/CRM/Admin/Form/Job.php index b1fede1a23..3f11c76ac3 100644 --- a/CRM/Admin/Form/Job.php +++ b/CRM/Admin/Form/Job.php @@ -119,7 +119,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form { * @param array $fields * * @return array|bool - * @throws API_Exception + * @throws CRM_Core_Exception */ public static function formRule($fields) { diff --git a/CRM/Admin/Form/MessageTemplates.php b/CRM/Admin/Form/MessageTemplates.php index efabfc033a..d4be6aaa9b 100644 --- a/CRM/Admin/Form/MessageTemplates.php +++ b/CRM/Admin/Form/MessageTemplates.php @@ -44,7 +44,6 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Core_Form { /** * PreProcess form - load existing values. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -268,7 +267,6 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Core_Form { /** * Process the form submission. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ diff --git a/CRM/Admin/Form/PaymentProcessor.php b/CRM/Admin/Form/PaymentProcessor.php index 83ddd79bc9..bf420ff716 100644 --- a/CRM/Admin/Form/PaymentProcessor.php +++ b/CRM/Admin/Form/PaymentProcessor.php @@ -403,7 +403,6 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { /** * Process the form submission. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function postProcess() { @@ -451,7 +450,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { * @param int $domainID * @param bool $test * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function updatePaymentProcessor(&$values, $domainID, $test) { if ($test) { diff --git a/CRM/Admin/Form/Preferences.php b/CRM/Admin/Form/Preferences.php index 33a23e5e47..81af6d0903 100644 --- a/CRM/Admin/Form/Preferences.php +++ b/CRM/Admin/Form/Preferences.php @@ -122,7 +122,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form { $this->saveMetadataDefinedSettings($this->_params); $this->filterParamsSetByMetadata($this->_params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { CRM_Core_Session::setStatus($e->getMessage(), ts('Save Failed'), 'error'); } diff --git a/CRM/Admin/Form/Preferences/Contribute.php b/CRM/Admin/Form/Preferences/Contribute.php index 0072d060be..7729a1f170 100644 --- a/CRM/Admin/Form/Preferences/Contribute.php +++ b/CRM/Admin/Form/Preferences/Contribute.php @@ -38,7 +38,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences { /** * Build the form object. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function buildQuickForm() { diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index 4f4420b5a2..303285de31 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -48,7 +48,6 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { * Build the form object. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm(): void { parent::buildQuickForm(); @@ -302,7 +301,6 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { * @return array|bool * True if no errors, else array of errors * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function formRule(array $fields, $files, $self) { @@ -483,7 +481,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { * The submitted form values. * * @return CRM_Core_DAO_ActionSchedule - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function parseActionSchedule($values) { diff --git a/CRM/Admin/Form/Setting.php b/CRM/Admin/Form/Setting.php index 0011769f4d..745bd5881c 100644 --- a/CRM/Admin/Form/Setting.php +++ b/CRM/Admin/Form/Setting.php @@ -95,7 +95,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form { try { $this->saveMetadataDefinedSettings($params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { CRM_Core_Session::setStatus($e->getMessage(), ts('Save Failed'), 'error'); } diff --git a/CRM/Admin/Form/SettingTrait.php b/CRM/Admin/Form/SettingTrait.php index 3a3abc0dbb..705e0ab600 100644 --- a/CRM/Admin/Form/SettingTrait.php +++ b/CRM/Admin/Form/SettingTrait.php @@ -173,7 +173,6 @@ trait CRM_Admin_Form_SettingTrait { * Add fields in the metadata to the template. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function addFieldsDefinedInSettingsMetadata() { $this->addSettingsToFormFromMetadata(); @@ -323,7 +322,6 @@ trait CRM_Admin_Form_SettingTrait { * * All others are pending conversion. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ protected function setDefaultsForMetadataDefinedFields() { @@ -351,7 +349,7 @@ trait CRM_Admin_Form_SettingTrait { * @param array $params * Form input. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function saveMetadataDefinedSettings($params) { $settings = $this->getSettingsToSetByMetadata($params); @@ -402,7 +400,7 @@ trait CRM_Admin_Form_SettingTrait { /** * Add settings to form if the metadata designates they should be on the page. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function addSettingsToFormFromMetadata() { $filter = $this->getSettingPageFilter(); diff --git a/CRM/Admin/Page/PaymentProcessor.php b/CRM/Admin/Page/PaymentProcessor.php index c0758c5337..f30ee323ce 100644 --- a/CRM/Admin/Page/PaymentProcessor.php +++ b/CRM/Admin/Page/PaymentProcessor.php @@ -108,7 +108,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { * * @param null $action * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function browse($action = NULL): void { $paymentProcessors = PaymentProcessor::get(FALSE) @@ -138,7 +138,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { try { $paymentProcessors[$paymentProcessorID]['test_id'] = CRM_Financial_BAO_PaymentProcessor::getTestProcessorId($paymentProcessorID); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { CRM_Core_Session::setStatus(ts('No test processor entry exists for %1. Not having a test entry for each processor could cause problems', [$paymentProcessor['name']])); } } diff --git a/CRM/Batch/Form/Batch.php b/CRM/Batch/Form/Batch.php index 2c8ad45e7b..3f4b34af52 100644 --- a/CRM/Batch/Form/Batch.php +++ b/CRM/Batch/Form/Batch.php @@ -76,7 +76,7 @@ class CRM_Batch_Form_Batch extends CRM_Admin_Form { /** * Process the form submission. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function postProcess(): void { if ($this->_action & CRM_Core_Action::DELETE) { diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 4a74dcf2da..6058c00464 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -521,7 +521,6 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * Process the form after the input has been submitted and validated. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function postProcess() { $params = $this->controller->exportValues($this->_name); @@ -561,7 +560,6 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * @return bool * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ private function processContribution(&$params) { @@ -766,8 +764,6 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * batch total monetary amount. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ private function processMembership(array $params) { $batchTotal = 0; @@ -925,7 +921,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * * @return bool * true if mail was sent successfully - * @throws \CRM_Core_Exception|\API_Exception + * @throws \CRM_Core_Exception * */ protected function emailReceipt($form, &$formValues): bool { @@ -1027,7 +1023,6 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * @return bool * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testProcessContribution($params) { return $this->processContribution($params); @@ -1040,7 +1035,6 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * @return CRM_Member_BAO_Membership * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function legacyProcessMembership($customFieldsFormatted, $formDates = []): CRM_Member_DAO_Membership { $updateStatusId = FALSE; @@ -1179,7 +1173,6 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * @return bool * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ private function currentRowIsRenew(): bool { return $this->currentRowIsRenewOption === 2 && $this->getCurrentMembership(); @@ -1190,7 +1183,6 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * * @return array|bool * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ protected function getCurrentMembership() { diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index c45b8dffd3..4ec0524892 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -1876,7 +1876,7 @@ HERESQL; try { return civicrm_api3('Case', 'getcount', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Lack of permissions will throw an exception return 0; } @@ -2490,7 +2490,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; 'end_date' => ['IS NULL' => 1], ]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Lack of permissions will throw an exception $caseCount = 0; } @@ -2743,7 +2743,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; try { return (bool) civicrm_api3('Case', 'getcount', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Lack of permissions will throw an exception return FALSE; } @@ -2954,7 +2954,6 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * @param int $relTypeId * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function endCaseRole($caseId, $direction, $cid, $relTypeId) { // Validate inputs @@ -2987,7 +2986,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * Whatever is known about this dao object. * * @return array|bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * * @see CRM_Core_DAO::buildOptionsContext * @see CRM_Core_DAO::buildOptions @@ -3058,7 +3057,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * * @return mixed $emailFromContactId * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @see https://issues.civicrm.org/jira/browse/CRM-20308 */ public static function getReceiptFrom($activityID) { @@ -3117,7 +3116,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; try { $case = civicrm_api3('Case', 'getsingle', ['id' => $caseId]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Lack of permissions will throw an exception return 0; } @@ -3125,7 +3124,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; try { $caseType = civicrm_api3('CaseType', 'getsingle', ['id' => $case['case_type_id'], 'return' => ['definition']]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Lack of permissions will throw an exception return 'no case type found'; } @@ -3136,7 +3135,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; try { $relType = civicrm_api3('RelationshipType', 'getsingle', ['label_a_b' => $roleDetails['name']]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { } if (!empty($relType['id'])) { $roleDetails['id'] = $relType['id']; @@ -3146,7 +3145,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; try { $relTypeBa = civicrm_api3('RelationshipType', 'getsingle', ['label_b_a' => $roleDetails['name']]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { } if (!empty($relTypeBa['id'])) { if (!empty($roleDetails['direction'])) { diff --git a/CRM/Case/Form/Activity/OpenCase.php b/CRM/Case/Form/Activity/OpenCase.php index 65eb900f74..c159b6b2be 100644 --- a/CRM/Case/Form/Activity/OpenCase.php +++ b/CRM/Case/Form/Activity/OpenCase.php @@ -30,7 +30,6 @@ class CRM_Case_Form_Activity_OpenCase { * @param CRM_Case_Form_Case $form * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function preProcess(&$form) { //get multi client case configuration @@ -75,7 +74,7 @@ class CRM_Case_Form_Activity_OpenCase { * @param CRM_Case_Form_Case $form * * @return array $defaults - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function setDefaultValues(&$form) { $defaults = []; @@ -133,7 +132,7 @@ class CRM_Case_Form_Activity_OpenCase { /** * @param CRM_Case_Form_Case $form * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception */ public static function buildQuickForm(&$form) { diff --git a/CRM/Case/Form/ActivityToCase.php b/CRM/Case/Form/ActivityToCase.php index 95b2d6b7f7..34eb4fed41 100644 --- a/CRM/Case/Form/ActivityToCase.php +++ b/CRM/Case/Form/ActivityToCase.php @@ -53,7 +53,6 @@ class CRM_Case_Form_ActivityToCase extends CRM_Core_Form { * @return array * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setDefaultValues() { $defaults = []; diff --git a/CRM/Case/Form/CustomData.php b/CRM/Case/Form/CustomData.php index 9e4bb5e2a0..62ec0fe8da 100644 --- a/CRM/Case/Form/CustomData.php +++ b/CRM/Case/Form/CustomData.php @@ -144,7 +144,7 @@ class CRM_Case_Form_CustomData extends CRM_Core_Form { * @param array $params New custom field values from form * * @return string - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function formatCustomDataChangesForDetail($params) { $formattedDetails = []; diff --git a/CRM/Case/Form/Search.php b/CRM/Case/Form/Search.php index d3ba7a07c4..3445bddd3d 100644 --- a/CRM/Case/Form/Search.php +++ b/CRM/Case/Form/Search.php @@ -334,7 +334,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { /** * Set the metadata for the form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setSearchMetadata() { $this->addSearchFieldMetadata(['Case' => CRM_Case_BAO_Query::getSearchFieldMetadata()]); diff --git a/CRM/Case/Page/AJAX.php b/CRM/Case/Page/AJAX.php index 21e78f82a7..d219fa9365 100644 --- a/CRM/Case/Page/AJAX.php +++ b/CRM/Case/Page/AJAX.php @@ -74,7 +74,7 @@ class CRM_Case_Page_AJAX { } /** - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function caseDetails() { $caseId = CRM_Utils_Type::escape($_GET['caseId'], 'Positive'); diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 087e4d9e51..1e8aa46a23 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -246,7 +246,6 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact implements Civi\Co * favour of exceptions * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE, $skipDelete = FALSE) { @@ -504,7 +503,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact implements Civi\Co * * @param array $params * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function ensureGreetingParamsAreSet(&$params) { $allGreetingParams = ['addressee' => 'addressee_id', 'postal_greeting' => 'postal_greeting_id', 'email_greeting' => 'email_greeting_id']; @@ -868,7 +867,6 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); * Was contact deleted? * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function deleteContact($id, $restore = FALSE, $skipUndelete = FALSE, $checkPermissions = TRUE) { @@ -1891,7 +1889,6 @@ ORDER BY civicrm_email.is_primary DESC"; * contact id created/edited * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function createProfileContact( diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index da904c31b8..7916e81b07 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -246,9 +246,7 @@ WHERE id IN ( $idString ) * @param int|null $previousEmployerID * @param bool $newContact * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function createCurrentEmployerRelationship($contactID, $employerID, $previousEmployerID = NULL, $newContact = FALSE): void { if (!$employerID) { @@ -357,7 +355,6 @@ WHERE id IN ( $idString ) * * @param int $previousEmployerID * - * @throws CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ private static function currentEmployerRelatedMembership($contactID, $employerID, $relationshipParams, $duplicate = FALSE, $previousEmployerID = NULL) { @@ -402,7 +399,6 @@ WHERE contact_a.employer_id=contact_b.id AND contact_b.id={$organizationId}; "; * Contact id ( mostly organization contact id). * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function clearCurrentEmployer($contactId, $employerId = NULL) { $query = "UPDATE civicrm_contact @@ -450,7 +446,7 @@ WHERE id={$contactId}; "; * @param string $title * fieldset title. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function buildOnBehalfForm(&$form, $contactType, $countryID, $stateID, $title) { $form->assign('contact_type', $contactType); diff --git a/CRM/Contact/BAO/ContactType.php b/CRM/Contact/BAO/ContactType.php index dcf4150abd..cf55ff487c 100644 --- a/CRM/Contact/BAO/ContactType.php +++ b/CRM/Contact/BAO/ContactType.php @@ -40,7 +40,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements * * @return bool * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function isActive($contactType) { $contact = self::contactTypeInfo(); @@ -55,7 +55,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements * @return array * Array of basic contact types information. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function basicTypeInfo($includeInactive = FALSE) { @@ -72,7 +72,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements * @return array * Array of basic contact types * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function basicTypes($all = FALSE) { @@ -84,7 +84,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements * @param string $key * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function basicTypePairs($all = FALSE, $key = 'name') { @@ -107,7 +107,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements * @return array * Array of sub type information, subset of getAllContactTypes. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function subTypeInfo($contactType = NULL, $all = FALSE) { $contactTypes = self::getAllContactTypes(); @@ -134,7 +134,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements * @return array * all subtypes OR list of subtypes associated to * a given basic contact type - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function subTypes($contactType = NULL, $all = FALSE, $columnName = 'name', $ignoreCache = FALSE) { if ($columnName === 'name') { @@ -212,7 +212,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements * * @return array|string * Array of basictypes with name as 'built-in name' and 'label' as value - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function contactTypePairs($all = FALSE, $typeName = NULL, $delimiter = NULL) { $types = self::contactTypeInfo($all); @@ -613,7 +613,7 @@ WHERE contact_sub_type LIKE '%{$subType}%'"; * @param string $typeName * * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function getLabel($typeName) { $types = self::contactTypeInfo(TRUE); @@ -860,7 +860,7 @@ WHERE ($subtypeClause)"; * SQL query instead of calling APIv4 to avoid an infinite loop. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function getAllContactTypes() { $cache = Civi::cache('contactTypes'); diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index fb0c083a38..7d96f04029 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -63,7 +63,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact implemen ], ])->execute(); } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { // A failure to create the history might be a deadlock or similar // This record is not important enough to trigger a larger fail. Civi::log()->warning('Failed to add civicrm_subscription_history record with error :error', ['error' => $e->getMessage()]); diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index 306cfcb553..6c451f8bc6 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -341,9 +341,7 @@ WHERE id IN ( $groupIDs ) * @param bool $force * deprecated parameter = Should we force a search through. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function load($group, $force = FALSE) { $groupID = (int) $group->id; @@ -500,7 +498,7 @@ ORDER BY gc.contact_id, g.children * @param int $groupID * * @return string - * @throws API_Exception + * @throws CRM_Core_Exception * @throws \Civi\API\Exception\NotImplementedException * @throws CRM_Core_Exception */ @@ -542,7 +540,6 @@ ORDER BY gc.contact_id, g.children * * @return string * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected static function getCustomSearchSQL(array $savedSearch, int $groupID) { $savedSearchID = $savedSearch['id']; @@ -575,7 +572,6 @@ ORDER BY gc.contact_id, g.children * * @return string * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected static function getQueryObjectSQL(array $savedSearch, int $groupID): string { $savedSearchID = $savedSearch['id']; @@ -641,9 +637,7 @@ ORDER BY gc.contact_id, g.children * to make it easy to switch to multiple. * @param CRM_Utils_SQL_TempTable $tempTableObject * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected static function buildGroupContactTempTable(array $groupIDs, $tempTableObject): void { $groups = Group::get(FALSE)->addWhere('id', 'IN', $groupIDs) @@ -663,9 +657,7 @@ ORDER BY gc.contact_id, g.children * @param int[] $groupIDs * @param string $temporaryTable * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function populateTemporaryTableWithContactsInGroups(array $groupIDs, string $temporaryTable): void { $childAndParentGroupIDs = array_merge($groupIDs, CRM_Contact_BAO_GroupNesting::getDescendentGroupIds($groupIDs)); @@ -792,9 +784,7 @@ ORDER BY gc.contact_id, g.children * @param string|null $children * * @return void - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected static function insertGroupContactsIntoTempTable(string $tempTableName, int $groupID, ?int $savedSearchID, ?string $children): void { if ($savedSearchID) { diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 92bdbddf19..40315dd334 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -116,7 +116,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { $relationshipIDs[] = $relationship['id']; $valid++; } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { switch ($e->getMessage()) { case 'Duplicate Relationship': $duplicate++; @@ -230,7 +230,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * * @return CRM_Contact_BAO_Relationship * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function add($params, $ids = []) { $params['id'] = CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params)); @@ -623,7 +623,6 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @return CRM_Contact_DAO_Relationship * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function del($id) { // delete from relationship table @@ -669,7 +668,6 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @param bool $active * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function disableEnableRelationship($id, $action, $params = [], $ids = [], $active = FALSE) { $relationship = self::clearCurrentEmployer($id, $action); @@ -951,7 +949,7 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); * * @return bool * - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ public static function setIsActive($id, $is_active) { // as both the create & add functions have a bunch of logic in them that @@ -967,7 +965,7 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); ]); if (is_array($result) && !empty($result['is_error']) && $result['error_message'] != 'Duplicate Relationship') { - throw new CiviCRM_API3_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result); + throw new CRM_Core_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result); } return TRUE; @@ -1029,7 +1027,6 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); * [select, from, where] * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function makeURLClause($contactId, $status, $numRelationship, $count, $relationshipId, $direction, $params = []) { $select = $from = $where = ''; @@ -1188,7 +1185,6 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) * relationship records * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function getRelationship( $contactId = NULL, @@ -1445,7 +1441,6 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) * @param bool $active * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function relatedMemberships($contactId, $params, $ids, $action = CRM_Core_Action::ADD, $active = TRUE) { // Check the end date and set the status of the relationship @@ -1839,7 +1834,7 @@ AND cc.sort_name LIKE '%$name%'"; * * @return bool * True on success, false if error is encountered. - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function disableExpiredRelationships() { $query = "SELECT id FROM civicrm_relationship WHERE is_active = 1 AND end_date < CURDATE()"; @@ -1867,7 +1862,7 @@ AND cc.sort_name LIKE '%$name%'"; * @param string $direction * * @return array|void - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function membershipTypeToRelationshipTypes(&$params, $direction = NULL) { $membershipType = civicrm_api3('membership_type', 'getsingle', [ @@ -2138,7 +2133,7 @@ AND cc.sort_name LIKE '%$name%'"; * * @return bool * TRUE if current employer needs to be cleared. - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function isCurrentEmployerNeedingToBeCleared($params, $relationshipId, $updatedRelTypeID = NULL) { $existingTypeID = (int) CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Relationship', $relationshipId, 'relationship_type_id'); @@ -2194,7 +2189,7 @@ AND cc.sort_name LIKE '%$name%'"; * @param int $cid * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private static function isInheritedMembershipInvalidated($membershipValues, array $values, $cid): array { // @todo most of this can go - it's just the weird historical returning of $relTypeId that it does. @@ -2219,7 +2214,7 @@ AND cc.sort_name LIKE '%$name%'"; * * @return bool * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private static function isContactHasValidRelationshipToInheritMembershipType(int $contactID, int $membershipTypeID, int $parentMembershipID): bool { $membershipType = CRM_Member_BAO_MembershipType::getMembershipType($membershipTypeID); diff --git a/CRM/Contact/BAO/RelationshipType.php b/CRM/Contact/BAO/RelationshipType.php index b2cc785173..0a24566a96 100644 --- a/CRM/Contact/BAO/RelationshipType.php +++ b/CRM/Contact/BAO/RelationshipType.php @@ -112,7 +112,7 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType * * @param \Civi\Core\Event\PreEvent $event * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function self_hook_civicrm_pre(PreEvent $event): void { @@ -141,12 +141,12 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType ->addWhere('contact_type_a', '=', 'Individual') ->addSelect('id')->execute()->first(); if (empty($relationship)) { - throw new API_Exception('no valid relationship'); + throw new CRM_Core_Exception('no valid relationship'); } Civi::cache('metadata')->set(__CLASS__ . __FUNCTION__, $relationship['id']); } } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { throw new CRM_Core_Exception(ts("You seem to have deleted the relationship type 'Employee of'")); } return Civi::cache('metadata')->get(__CLASS__ . __FUNCTION__); diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index b3a10d44e7..f12f4f576b 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -47,7 +47,6 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * the values of the posted saved search used as default values in various Search Form * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function getFormValues($id) { $specialDateFields = [ @@ -176,7 +175,6 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * @return array * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function getSearchParams($id) { $savedSearch = \Civi\Api4\SavedSearch::get(FALSE) @@ -339,7 +337,7 @@ WHERE $where"; * @param string $op * @param array|string|int $value * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function decodeRelativeFields(&$formValues, $fieldName, $op, $value) { // check if its a custom date field, if yes then 'searchDate' format the value diff --git a/CRM/Contact/Form/Domain.php b/CRM/Contact/Form/Domain.php index fd938776f0..2ccf0843e7 100644 --- a/CRM/Contact/Form/Domain.php +++ b/CRM/Contact/Form/Domain.php @@ -114,7 +114,7 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form { /** * Build the form object. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function buildQuickForm(): void { $this->addField('name', ['label' => ts('Organization Name')], TRUE); diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index d51ae147e0..8b88bb49c2 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -31,7 +31,7 @@ class CRM_Contact_Form_Edit_Address { * @param bool $inlineEdit * True when edit used in inline edit. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharing = TRUE, $inlineEdit = FALSE) { // passing this via the session is AWFUL. we need to fix this @@ -385,7 +385,6 @@ class CRM_Contact_Form_Edit_Address { * @param int $blockId * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected static function addCustomDataToForm(&$form, $entityId, $blockId) { $groupTree = CRM_Core_BAO_CustomGroup::getTree('Address', NULL, $entityId); diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 6203c629e6..4119d11725 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -527,7 +527,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { try { civicrm_api3('relationship', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { throw new CRM_Core_Exception('Relationship create error ' . $e->getMessage()); } @@ -590,7 +590,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { * @param array $relationshipIds * @param string $note * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private function saveRelationshipNotes($relationshipIds, $note) { foreach ($relationshipIds as $id) { diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index d39ad016af..7a139d3b4a 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -905,7 +905,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { /** * Load metadata for fields on the form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function loadMetadata() { // can't by pass acls by passing search criteria in the url. diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 1dda83c0cd..4d3d1810de 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -20,7 +20,6 @@ class CRM_Contact_Form_Search_Criteria { * @param CRM_Contact_Form_Search_Advanced $form * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function basic(&$form) { $form->addSearchFieldMetadata(['Contact' => self::getFilteredSearchFieldMetadata('basic')]); @@ -244,7 +243,7 @@ class CRM_Contact_Form_Search_Criteria { /** * Get the metadata for fields to be included on the contact search form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getSearchFieldMetadata() { $fields = [ @@ -291,7 +290,7 @@ class CRM_Contact_Form_Search_Criteria { * @param string $filter * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getFilteredSearchFieldMetadata($filter) { $fields = self::getSearchFieldMetadata(); @@ -308,7 +307,7 @@ class CRM_Contact_Form_Search_Criteria { * * @param CRM_Core_Form $form * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected static function setBasicSearchFields($form) { $searchFields = []; @@ -506,7 +505,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param CRM_Core_Form $form * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function changeLog(&$form) { $form->add('hidden', 'hidden_changeLog', 1); @@ -526,7 +525,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param CRM_Core_Form_Search $form * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function relationship(&$form) { $form->add('hidden', 'hidden_relationship', 1); @@ -559,7 +558,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param CRM_Core_Form_Search $form * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function demographics(&$form) { $form->add('hidden', 'hidden_demographics', 1); @@ -603,7 +602,7 @@ class CRM_Contact_Form_Search_Criteria { * * @param CRM_Contact_Form_Search $form * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function custom(&$form) { $form->add('hidden', 'hidden_custom', 1); diff --git a/CRM/Contact/Form/Task/Delete.php b/CRM/Contact/Form/Task/Delete.php index c2c9b7b8e3..44cd6be1f8 100644 --- a/CRM/Contact/Form/Task/Delete.php +++ b/CRM/Contact/Form/Task/Delete.php @@ -287,7 +287,7 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task { /** * Restore the selected contact/s from the trash. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function doRestore() { diff --git a/CRM/Contact/Form/Task/Email.php b/CRM/Contact/Form/Task/Email.php index 072ff37d78..41b8515ec8 100644 --- a/CRM/Contact/Form/Task/Email.php +++ b/CRM/Contact/Form/Task/Email.php @@ -25,7 +25,6 @@ class CRM_Contact_Form_Task_Email extends CRM_Contact_Form_Task { /** * Build all the data structures needed to build the form. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function preProcess() { diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index 22f1b995c6..11dd937fa2 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -28,7 +28,7 @@ class CRM_Contact_Form_Task_EmailCommon { * @param CRM_Core_Form $form * @param bool $bounce determine if we want to throw a status bounce. * - * @throws \API_Exception|\CRM_Core_Exception + * @throws \CRM_Core_Exception */ public static function preProcessFromAddress(&$form, $bounce = TRUE) { $form->_emails = []; diff --git a/CRM/Contact/Form/Task/EmailTrait.php b/CRM/Contact/Form/Task/EmailTrait.php index c8085c40a2..575b07cb26 100644 --- a/CRM/Contact/Form/Task/EmailTrait.php +++ b/CRM/Contact/Form/Task/EmailTrait.php @@ -101,7 +101,6 @@ trait CRM_Contact_Form_Task_EmailTrait { /** * Build all the data structures needed to build the form. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function preProcess() { @@ -116,7 +115,6 @@ trait CRM_Contact_Form_Task_EmailTrait { * later. * * @throws \CRM_Core_Exception - * @throws \API_Exception */ protected function traitPreProcess(): void { $this->addExpectedSmartyVariable('rows'); @@ -303,7 +301,6 @@ trait CRM_Contact_Form_Task_EmailTrait { * * @return array * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function setDefaultValues(): array { @@ -322,10 +319,8 @@ trait CRM_Contact_Form_Task_EmailTrait { /** * Process the form after the input has been submitted and validated. * - * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function postProcess() { $this->bounceIfSimpleMailLimitExceeded(count($this->_contactIds)); @@ -355,10 +350,8 @@ trait CRM_Contact_Form_Task_EmailTrait { * * @param array $formValues * - * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function submit($formValues): void { $this->saveMessageTemplate($formValues); @@ -415,7 +408,7 @@ trait CRM_Contact_Form_Task_EmailTrait { * * @param array $formValues * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function saveMessageTemplate($formValues) { @@ -444,7 +437,7 @@ trait CRM_Contact_Form_Task_EmailTrait { * Get the emails from the added element. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getEmails(): array { $allEmails = explode(',', $this->getSubmittedValue('to')); @@ -484,7 +477,7 @@ trait CRM_Contact_Form_Task_EmailTrait { * @return string * e.g. "Smith, Bob". * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function getEmailString(array $emailIDs): string { @@ -735,7 +728,6 @@ trait CRM_Contact_Form_Task_EmailTrait { * bool $sent FIXME: this only indicates the status of the last email sent. * array $activityIds The activity ids created, one per "To" recipient. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \PEAR_Exception * @internal @@ -976,7 +968,6 @@ trait CRM_Contact_Form_Task_EmailTrait { * * @return array * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function getRowsForEmails(): array { @@ -1035,7 +1026,7 @@ trait CRM_Contact_Form_Task_EmailTrait { /** * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function getBcc(): string { @@ -1044,7 +1035,7 @@ trait CRM_Contact_Form_Task_EmailTrait { /** * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function getCc(): string { diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index bae7d601a7..6c18f1dc90 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -115,8 +115,6 @@ class CRM_Contact_Form_Task_PDFLetterCommon extends CRM_Core_Form_Task_PDFLetter * @param CRM_Core_Form $form * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception * * @deprecated */ diff --git a/CRM/Contact/Form/Task/PDFTrait.php b/CRM/Contact/Form/Task/PDFTrait.php index 61e4faad36..0889902391 100644 --- a/CRM/Contact/Form/Task/PDFTrait.php +++ b/CRM/Contact/Form/Task/PDFTrait.php @@ -220,8 +220,6 @@ trait CRM_Contact_Form_Task_PDFTrait { * Process the form after the input has been submitted and validated. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public function postProcess(): void { $formValues = $this->controller->exportValues($this->getName()); @@ -332,7 +330,6 @@ trait CRM_Contact_Form_Task_PDFTrait { * and use-case. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function createActivities($html_message, $contactIds, $subject, $campaign_id, $perContactHtml = []): array { $activityParams = [ @@ -401,7 +398,6 @@ trait CRM_Contact_Form_Task_PDFTrait { * @return string $html_message * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function processTemplate(&$formValues) { diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index 068450aba5..ab86a34777 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -178,7 +178,6 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Import_Form_DataSource { * Call the DataSource's postProcess method. * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function postProcess() { $this->controller->resetPage('MapField'); diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index cec46c953a..5a8b5d0cdc 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -67,7 +67,6 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { /** * Set variables up before form is built. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -108,7 +107,6 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { /** * Build the form object. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function buildQuickForm() { @@ -394,7 +392,6 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { * @param $params * @param $mapperKeys * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function submit($params) { diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php index e651cf78bf..c133b99c1c 100644 --- a/CRM/Contact/Import/Form/Preview.php +++ b/CRM/Contact/Import/Form/Preview.php @@ -118,7 +118,7 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview { /** * Process the mapped fields and map it into the uploaded file. * - * @throws \API_Exception|\CRM_Core_Exception + * @throws \CRM_Core_Exception */ public function postProcess(): void { $groupsToAddTo = (array) $this->getSubmittedValue('groups'); diff --git a/CRM/Contact/Import/Form/Summary.php b/CRM/Contact/Import/Form/Summary.php index bae571b673..45c8dcfd3c 100644 --- a/CRM/Contact/Import/Form/Summary.php +++ b/CRM/Contact/Import/Form/Summary.php @@ -25,7 +25,6 @@ class CRM_Contact_Import_Form_Summary extends CRM_Import_Forms { /** * Set variables up before form is built. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function preProcess(): void { @@ -57,7 +56,6 @@ class CRM_Contact_Import_Form_Summary extends CRM_Import_Forms { /** * Assign the relevant smarty variables. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 48169889fa..41a95ebadf 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -488,7 +488,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { /** * @param array $params * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\NotImplementedException */ @@ -545,7 +544,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param $primaryContactId * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function createRelationship($key, $relContactId, $primaryContactId): void { //if more than one duplicate contact @@ -1056,7 +1054,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * IDs of a possible. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function getPossibleContactMatch(array $params, ?int $extIDMatch, $dedupeRuleID): ?int { $possibleMatches = $this->getPossibleMatchesByDedupeRule($params, $dedupeRuleID, FALSE); @@ -1156,7 +1153,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param array $values * * @return bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function formatLocationBlock(&$values) { // @todo - remove this function. @@ -1233,7 +1230,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * - address, email, phone * @param int|null $contactID * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function fillPrimary(&$params, $values, $entity, $contactID) { if ($values['location_type_id'] === 'Primary') { @@ -1270,7 +1267,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param int $columnNumber * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getMappingFieldFromMapperInput(array $fieldMapping, int $mappingID, int $columnNumber): array { $isRelationshipField = preg_match('/\d*_a_b|b_a$/', $fieldMapping[0]); @@ -1302,7 +1299,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * or as returned from getMappingFieldFromMapperInput * * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getMappedFieldLabel(array $mappedField): string { $this->setFieldMetadata(); @@ -1333,7 +1330,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param string $direction * * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getRelationshipLabel(int $id, string $direction): string { if (empty($this->relationshipLabels[$id . $direction])) { @@ -1364,7 +1361,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * '5_a_b' => ['contact_type' => 'Organization', 'url' => ['url' => 'https://example.org', 'website_type_id' => 1]] * 'im' => ['im' => 'my-handle', 'location_type_id' => 1, 'provider_id' => 1], * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getMappedRow(array $values): array { $params = ['relationship' => []]; @@ -1414,7 +1411,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param string $prefixString * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\NotImplementedException */ protected function getInvalidValuesForContact($value, string $prefixString): array { @@ -1438,7 +1435,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * Also 'im_provider_id' is mapped to the 'real' field name 'provider_id' * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getFieldMappings(): array { $mappedFields = []; @@ -1466,7 +1463,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * * @return null|string * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getRelatedContactType($relationshipTypeID, $relationshipDirection): ?string { if (!$relationshipTypeID) { @@ -1484,7 +1481,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * * @return null|string * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getRelatedContactSubType(int $relationshipTypeID, $relationshipDirection): ?string { if (!$relationshipTypeID) { @@ -1502,7 +1499,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * * @return null|string * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getRelatedContactLabel($relationshipTypeID, $relationshipDirection): ?string { $relationshipField = 'label_' . $relationshipDirection; @@ -1515,7 +1512,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param int $relationshipTypeID * * @return string[] - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getRelationshipType(int $relationshipTypeID): array { $cacheKey = 'relationship_type' . $relationshipTypeID; @@ -1536,7 +1533,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param mixed $importedValue * * @return void - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function addFieldToParams(array &$contactArray, array $locationValues, string $fieldName, $importedValue): void { if (!empty($locationValues)) { @@ -1585,7 +1582,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * * @return array * e.g ['5_a_b' => ['contact_type' => 'Organization', 'organization_name' => 'The Firm']] - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getRelatedContactsParams(array $params): array { $relatedContacts = []; @@ -1612,9 +1609,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * * @return int|null * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function lookupContactID(array $params, bool $isMainContact): ?int { @@ -1648,9 +1643,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param bool $isMainContact * * @return array[] - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function processContact(array $params, array $formatted, bool $isMainContact): array { $params['id'] = $formatted['id'] = $this->lookupContactID($params, $isMainContact); @@ -1677,7 +1670,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param int|null|string $countryID * * @return int|string - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ private function tryToResolveStateProvince(string $stateProvince, $countryID) { @@ -1715,7 +1708,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function fillStateProvince(array &$params): array { foreach ($params as $key => $value) { @@ -1748,7 +1741,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * @param array $possibleStates * * @return int|null - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function checkStatesForCountry(int $countryID, array $possibleStates) { foreach ($possibleStates as $index => $state) { diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index dfe05659bc..b3905925ea 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -249,7 +249,7 @@ class CRM_Contact_Page_AJAX { ]); $result = civicrm_api3('relationship', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { $ret['is_error'] = 1; $ret['error_message'] = $e->getMessage(); } @@ -811,7 +811,7 @@ LIMIT {$offset}, {$rowCount} civicrm_api3('Exception', 'create', ['contact_id1' => $cid, 'contact_id2' => $oid]); return TRUE; } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { return FALSE; } } diff --git a/CRM/Contact/Page/DedupeMerge.php b/CRM/Contact/Page/DedupeMerge.php index 25d38f803a..559ab66764 100644 --- a/CRM/Contact/Page/DedupeMerge.php +++ b/CRM/Contact/Page/DedupeMerge.php @@ -121,8 +121,6 @@ class CRM_Contact_Page_DedupeMerge extends CRM_Core_Page { * @return int * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public static function callBatchMerge(CRM_Queue_TaskContext $ctx, $rgid, $gid, $mode, $batchLimit, $isSelected, $criteria, $searchLimit) { CRM_Dedupe_Merger::batchMerge($rgid, $gid, $mode, $batchLimit, $isSelected, $criteria, TRUE, FALSE, $searchLimit); diff --git a/CRM/Contact/Page/View.php b/CRM/Contact/Page/View.php index e93d8925b8..36cd8e0c98 100644 --- a/CRM/Contact/Page/View.php +++ b/CRM/Contact/Page/View.php @@ -303,7 +303,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page { try { $mergedTo = civicrm_api3('Contact', 'getmergedto', ['contact_id' => $contactId, 'api.Contact.get' => ['return' => 'display_name']]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { CRM_Core_Session::singleton()->setStatus(ts('This contact was deleted during a merge operation. The contact it was merged into cannot be found and may have been deleted.')); $mergedTo = ['count' => 0]; } diff --git a/CRM/Contact/Page/View/Relationship.php b/CRM/Contact/Page/View/Relationship.php index 709eb5641b..faa48927c7 100644 --- a/CRM/Contact/Page/View/Relationship.php +++ b/CRM/Contact/Page/View/Relationship.php @@ -61,7 +61,6 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { * View details of a relationship. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function view() { $viewRelationship = CRM_Contact_BAO_Relationship::getRelationship($this->getContactId(), NULL, NULL, NULL, $this->getEntityId()); diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 85b388a1b8..07bded7595 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -104,9 +104,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { /** * View summary details of a contact. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function view() { // Add js for tabs, in-place editing, and jstree for tags @@ -453,7 +451,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { * @param string $entity * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getLocationValues(int $contact_id, string $entity): array { $fieldMap = [ diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index e534cac54f..fbf79c1b7d 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -87,7 +87,6 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution im * * @return \CRM_Contribute_BAO_Contribution * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function add(&$params) { if (empty($params)) { @@ -353,7 +352,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution im * @param int|null $contributionID * Contribution ID if we are dealing with an update. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function calculateMissingAmountParams(&$params, $contributionID) { if (!$contributionID && (!isset($params['fee_amount']) || $params['fee_amount'] === '')) { @@ -471,9 +470,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution im * * @return CRM_Contribute_BAO_Contribution * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function create(&$params) { @@ -882,7 +879,6 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution im * @param string $trxnDate * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function recordPaymentActivity($contributionId, $participantId, $totalAmount, $currency, $trxnDate) { $activityType = ($totalAmount < 0) ? 'Refund' : 'Payment'; @@ -933,7 +929,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution im * @param int $contributionID * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected static function getRelatedMemberships(int $contributionID): array { $membershipIDs = array_keys((array) LineItem::get(FALSE) @@ -1073,7 +1069,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution im * @param int $recurringContributionID * * @return bool - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected static function isEmailReceipt(array $input, int $contributionID, $recurringContributionID): bool { if (isset($input['is_email_receipt'])) { @@ -1179,7 +1175,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = c.contact_id ) * * @return mixed|null * $results no of deleted Contribution on success, false otherwise - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function deleteContribution($id) { @@ -1233,7 +1228,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = c.contact_id ) * @param array[] $records * * @return static[] - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function deleteRecords(array $records): array { @@ -1258,7 +1252,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = c.contact_id ) * @param int $contactID * @param string $message * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function failPayment($contributionID, $contactID, $message) { civicrm_api3('activity', 'create', [ @@ -1778,8 +1772,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ * * @param array $params * - * @throws CRM_Core_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @deprecated * * Use api contribute.completetransaction @@ -2161,8 +2154,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ * @param array $contributionParams * * @return bool|array - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException * @todo * 1) many processors still call repeattransaction with contribution_status_id = Completed @@ -3513,7 +3505,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * @param string $trxn_date * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function addActivityForPayment($targetCid, $activityType, $title, $contributionId, $totalAmount, $currency, $trxn_date) { $paymentAmount = CRM_Utils_Money::format($totalAmount, $currency); @@ -3553,7 +3544,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * @return mixed * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function getPaymentInfo($id, $component = 'contribution', $getTrxnInfo = FALSE) { // @todo deprecate passing in component - always call with contribution. @@ -3749,7 +3739,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * Contribution ID. * * @return bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function isSingleLineItem($id) { $lineItemCount = civicrm_api3('LineItem', 'getcount', ['contribution_id' => $id]); @@ -3774,9 +3764,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * transitioning related elements). * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function completeOrder($input, $recurringContributionID, $contributionID, $isPostPaymentCreate = FALSE) { $transaction = new CRM_Core_Transaction(); @@ -3890,7 +3878,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * * @return array * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Exception */ public static function sendMail($input, $ids, $contributionID, $returnMessageText = FALSE) { @@ -4009,7 +3996,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * * @param float $contributionTotalAmount * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function assignProportionalLineItems($trxnParams, $trxnId, $contributionTotalAmount) { $lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($trxnParams['contribution_id']); @@ -4152,7 +4139,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * @param string $changeDate * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function updateMembershipBasedOnCompletionOfContribution($contributionID, $changeDate) { $memberships = self::getRelatedMemberships((int) $contributionID); @@ -4483,7 +4469,7 @@ LIMIT 1;"; * * @param array $eftParams * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function createProportionalEntry($entityParams, $eftParams) { $paid = 0; @@ -4541,7 +4527,7 @@ LIMIT 1;"; * * @param array $taxItems * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function createProportionalFinancialEntries($entityParams, $lineItems, $ftIds, $taxItems) { $eftParams = [ @@ -4611,7 +4597,7 @@ LIMIT 1;"; * @deprecated * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function replaceContributionTokens( $contributionIds, diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 2303e6e946..43c88cfbbc 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -511,7 +511,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio * Contribution page id. * @param object $recur * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function recurringNotify($contributionID, $type, $recur): void { $contribution = Contribution::get(FALSE) diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php index 06829110fc..36f1c5b368 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -448,8 +448,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) * * @param int $id * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException * @return int|NULL the ID of the newly created template contribution. */ @@ -529,7 +528,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function getTemplateContribution(int $id, array $inputOverrides = []): array { $recurringContribution = ContributionRecur::get(FALSE) @@ -745,7 +744,6 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) * * @return array * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function addRecurLineItems($recurId, $contribution) { $foundLineItems = FALSE; @@ -764,7 +762,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) 'is_transactional' => FALSE, ]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // we are catching & ignoring errors as an extra precaution since lost IPNs may be more serious that lost membership_payment data // this fn is unit-tested so risk of changes elsewhere breaking it are otherwise mitigated } @@ -797,7 +795,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) * @param int $contributionStatusID * @param float $contributionAmount * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function updateRecurLinkedPledge($contributionID, $contributionRecurID, $contributionStatusID, $contributionAmount) { $returnProperties = ['id', 'pledge_id']; @@ -894,7 +892,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) /** * Get the metadata for fields to be included on the search form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getContributionRecurSearchFieldMetadata() { $fields = [ @@ -940,7 +938,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) * - Failed * @param string $effectiveDate * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function updateOnNewPayment($recurringContributionID, $paymentStatus, string $effectiveDate = 'now') { @@ -995,7 +993,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) * * @param \CRM_Contribute_DAO_Contribution $contribution * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function updateOnTemplateUpdated(CRM_Contribute_DAO_Contribution $contribution) { @@ -1053,7 +1051,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) * @param int $financial_type_id * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function calculateRecurLineItems($recurId, $total_amount, $financial_type_id) { $originalContribution = civicrm_api3('Contribution', 'getsingle', [ @@ -1119,7 +1117,6 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) * @internal * * @return string - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function getRecurFromAddress(int $id): string { diff --git a/CRM/Contribute/BAO/ContributionSoft.php b/CRM/Contribute/BAO/ContributionSoft.php index 14c833c002..a38c720204 100644 --- a/CRM/Contribute/BAO/ContributionSoft.php +++ b/CRM/Contribute/BAO/ContributionSoft.php @@ -52,7 +52,6 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * @param CRM_Contribute_BAO_Contribution $contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function processSoftContribution($params, $contribution) { if (array_key_exists('pcp', $params)) { @@ -351,7 +350,6 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * @return array * Associated array of soft contributions * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function getSoftContributionSelector($params): array { @@ -387,7 +385,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function getSoftContributionList($contact_id, ?int $membershipID = NULL, $isTest = 0, &$dTParams = NULL): array { // This is necessary for dataTables sorting. @@ -552,8 +550,6 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * @param \CRM_Contribute_BAO_Contribution $contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ protected static function processPCP($pcp, $contribution) { $pcpId = self::getSoftCreditIds($contribution->id, TRUE); @@ -593,7 +589,6 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * @param array $contributionSoft * Contribution object. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function pcpNotifyOwner(int $contributionID, array $contributionSoft): void { diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 5654fabb02..ac6ea213b4 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -98,7 +98,6 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { * @param CRM_Contact_BAO_Query $query * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function where(&$query) { self::initializeAnySoftCreditClause($query); @@ -122,7 +121,6 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { * @param array $values * @param CRM_Contact_BAO_Query $query * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public static function whereClauseSingle(&$values, &$query) { @@ -883,7 +881,7 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { /** * Get the metadata for fields to be included on the search form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getSearchFieldMetadata() { $fields = [ @@ -906,7 +904,6 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { * @param \CRM_Contribute_Form_Search $form * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function buildSearchForm(&$form) { diff --git a/CRM/Contribute/Exception/CheckLineItemsException.php b/CRM/Contribute/Exception/CheckLineItemsException.php index cdf90dd5c2..94303d89fc 100644 --- a/CRM/Contribute/Exception/CheckLineItemsException.php +++ b/CRM/Contribute/Exception/CheckLineItemsException.php @@ -3,7 +3,7 @@ /** * Class CRM_Contribute_Exception_CheckLineItemsException */ -class CRM_Contribute_Exception_CheckLineItemsException extends API_Exception { +class CRM_Contribute_Exception_CheckLineItemsException extends CRM_Core_Exception { const LINE_ITEM_DIFFERRING_TOTAL_EXCEPTON_MSG = "Line item total doesn't match total amount."; public function __construct($message = self::LINE_ITEM_DIFFERRING_TOTAL_EXCEPTON_MSG, $error_code = 0, array $extraParams = [], $previous = NULL) { diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index b16638ac6f..1aa0ee72f4 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -272,7 +272,6 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task { * Pre process function with common actions. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this); diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index 35cd1fb601..d392996929 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -61,7 +61,6 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract * Pre process form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { @@ -169,7 +168,6 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract * Build the form object. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm() { if ($this->_view === 'transaction' && ($this->_action & CRM_Core_Action::BROWSE)) { @@ -280,7 +278,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract /** * Process the form submission. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function postProcess() { $submittedValues = $this->controller->exportValues($this->_name); @@ -300,7 +298,6 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract * * @param array $submittedValues * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function submit($submittedValues) { @@ -447,7 +444,6 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract * @param string|null $creditCardMode * @param string $entityType * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testSubmit($params, $creditCardMode = NULL, $entityType = 'contribute') { diff --git a/CRM/Contribute/Form/CancelSubscription.php b/CRM/Contribute/Form/CancelSubscription.php index 281b372683..940b8256b0 100644 --- a/CRM/Contribute/Form/CancelSubscription.php +++ b/CRM/Contribute/Form/CancelSubscription.php @@ -195,7 +195,6 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Contribute_Form_Contrib * Process the form submission. * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function postProcess() { $message = NULL; @@ -276,7 +275,7 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Contribute_Form_Contrib list($sent) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams); } } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { $msgType = 'error'; $msgTitle = ts('Error'); if ($params['send_cancel_request'] == 1) { diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 2c2aaa3068..60cc091581 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -219,7 +219,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * Set variables up before form is built. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { // Check permission for action. @@ -473,9 +472,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP /** * Build the form object. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function buildQuickForm() { if ($this->_id) { @@ -1009,7 +1006,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * * @throws \CRM_Core_Exception * @throws \Civi\Payment\Exception\PaymentProcessorException - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function processCreditCard($submittedValues, $lineItem, $contactID) { $isTest = ($this->_mode == 'test') ? 1 : 0; @@ -1177,9 +1174,9 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP // This has now been set to 1 in the DB - declare it here also $contribution->contribution_status_id = 1; } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { if ($e->getErrorCode() != 'contribution_completed') { - \Civi::log()->error('CRM_Contribute_Form_Contribution::processCreditCard CiviCRM_API3_Exception: ' . $e->getMessage()); + \Civi::log()->error('CRM_Contribute_Form_Contribution::processCreditCard CRM_Core_Exception: ' . $e->getMessage()); throw new CRM_Core_Exception('Failed to update contribution in database'); } } @@ -1241,7 +1238,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * @return \CRM_Contribute_DAO_Contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ private function processFormContribution( $params, @@ -1455,7 +1451,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * @return CRM_Contribute_BAO_Contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\Payment\Exception\PaymentProcessorException */ public function testSubmit($params, $action, $creditCardMode = NULL) { @@ -1519,7 +1514,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * @return \CRM_Contribute_BAO_Contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\Payment\Exception\PaymentProcessorException */ protected function submit($submittedValues, $action, $pledgePaymentID) { @@ -2035,7 +2029,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * * @return string|null * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getPreviousContributionStatus(): ?string { if (!$this->getContributionID()) { @@ -2060,7 +2054,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * is that it might exclude the current status of the contribution. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getAvailableContributionStatuses(): array { if (!$this->getPreviousContributionStatus()) { diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index e0c6f0522f..6b39411131 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -669,7 +669,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @return bool * Is this a separate membership payment * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ private function buildMembershipBlock($cid, $selectedMembershipTypeID = NULL, $isTest = NULL) { @@ -1042,7 +1041,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @return \CRM_Contribute_DAO_Contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @todo - this code was previously shared with the backoffice form - some parts of this * function may relate to that form, not this one. * @@ -1493,7 +1491,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * Line items for payment options chosen on the form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\Payment\Exception\PaymentProcessorException */ protected function postProcessMembership( @@ -1735,9 +1732,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr 'pan_truncation' => $result['result']['pan_truncation'] ?? NULL, ]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { if ($e->getErrorCode() != 'contribution_completed') { - \Civi::log()->error('CRM_Contribute_Form_Contribution_Confirm::completeTransaction CiviCRM_API3_Exception: ' . $e->getMessage()); + \Civi::log()->error('CRM_Contribute_Form_Contribution_Confirm::completeTransaction CRM_Core_Exception: ' . $e->getMessage()); throw new CRM_Core_Exception('Failed to update contribution in database'); } } @@ -1773,9 +1770,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr 'is_transactional' => FALSE, ]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { if ($e->getErrorCode() != 'contribution_completed') { - \Civi::log()->error('CRM_Contribute_Form_Contribution_Confirm::completeTransaction CiviCRM_API3_Exception: ' . $e->getMessage()); + \Civi::log()->error('CRM_Contribute_Form_Contribution_Confirm::completeTransaction CRM_Core_Exception: ' . $e->getMessage()); throw new CRM_Core_Exception('Failed to update contribution in database'); } } @@ -1820,7 +1817,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @return array [] * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\Payment\Exception\PaymentProcessorException */ private function processSecondaryFinancialTransaction($contactID, $tempParams, $isTest, $lineItems, $minimumFee, @@ -2001,7 +1997,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @param array $params * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function submit($params) { @@ -2098,7 +2093,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @param array $params * * @return array - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ public static function getFormParams($id, array $params) { if (!isset($params['is_pay_later'])) { @@ -2128,7 +2123,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @return array * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function processFormSubmission($contactID) { @@ -2419,9 +2413,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr 'pan_truncation' => $result['pan_truncation'] ?? NULL, ]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { if ($e->getErrorCode() != 'contribution_completed') { - \Civi::log()->error('CRM_Contribute_Form_Contribution_Confirm::completeTransaction CiviCRM_API3_Exception: ' . $e->getMessage()); + \Civi::log()->error('CRM_Contribute_Form_Contribution_Confirm::completeTransaction CRM_Core_Exception: ' . $e->getMessage()); throw new CRM_Core_Exception('Failed to update contribution in database'); } } @@ -2601,7 +2595,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @param array $result * @param int $contributionID * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception */ protected function completeTransaction($result, $contributionID) { @@ -2619,9 +2613,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr 'pan_truncation' => $result['pan_truncation'] ?? NULL, ]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { if ($e->getErrorCode() != 'contribution_completed') { - \Civi::log()->error('CRM_Contribute_Form_Contribution_Confirm::completeTransaction CiviCRM_API3_Exception: ' . $e->getMessage()); + \Civi::log()->error('CRM_Contribute_Form_Contribution_Confirm::completeTransaction CRM_Core_Exception: ' . $e->getMessage()); throw new CRM_Core_Exception('Failed to update contribution in database'); } } @@ -2873,7 +2867,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * * @return array * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function unitTestAccessTolegacyProcessMembership($contactID, $membershipTypeID, $membershipID = NULL) { return self::legacyProcessMembership( @@ -2913,7 +2906,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * * @return array * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected static function legacyProcessMembership($contactID, $membershipTypeID, $is_test, $changeToday, $modifiedID, $customFieldsFormatted, $numRenewTerms, $membershipID, $pending, $contributionRecurID, $membershipSource, $isPayLater, $memParams = [], $contribution = NULL, $lineItems = []) { $renewalMode = $updateStatusId = FALSE; diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 4c1f7cab60..afa1884413 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -532,7 +532,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu * @return bool * Is this a separate membership payment * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ private function buildMembershipBlock($cid, $selectedMembershipTypeID = NULL, $isTest = NULL) { @@ -1230,7 +1229,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu * @param array $params * Submitted values. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function submit($params) { //carry campaign from profile. @@ -1525,7 +1524,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu * * @param array $params * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testSubmit($params) { $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -1539,7 +1538,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu * @param array $params * * @return mixed - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function hasSeparateMembershipPaymentAmount($params) { return $this->_separateMembershipPayment && (int) CRM_Member_BAO_MembershipType::getMembershipType($params['selectMembership'])['minimum_fee']; diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index 91a8bcbcc0..8887d38f7f 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -304,7 +304,6 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont * @return bool * Is this a separate membership payment * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ private function buildMembershipBlock($cid, $selectedMembershipTypeID = NULL, $isTest = NULL) { @@ -474,7 +473,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont ]); return TRUE; } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { return FALSE; } } diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 964340fb3b..0accaa7594 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -752,7 +752,6 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { * Assign payment field information to the template. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function assignPaymentFields() { //fix for CRM-3767 @@ -812,9 +811,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { * @param int $id * @param CRM_Core_Form $form * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildComponentForm($id, $form): void { if (empty($id)) { @@ -1193,7 +1190,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { * * @return float * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getMainContributionAmount($params) { if (!empty($params['selectMembership'])) { diff --git a/CRM/Contribute/Form/ContributionView.php b/CRM/Contribute/Form/ContributionView.php index 16d7c65cad..f7693be076 100644 --- a/CRM/Contribute/Form/ContributionView.php +++ b/CRM/Contribute/Form/ContributionView.php @@ -26,7 +26,6 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form { * Set variables up before form is built. * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function preProcess() { $id = $this->getID(); @@ -121,7 +120,7 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form { ->addWhere('contribution_id', '=', $id) ->execute(); } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { // likely don't have permission for events/participants $participantLineItems = []; } @@ -380,7 +379,7 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form { ->addValue('id', $this->getID()) ->execute()->first()['access']; } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { return FALSE; } } diff --git a/CRM/Contribute/Form/ManagePremiums.php b/CRM/Contribute/Form/ManagePremiums.php index 0514965c6d..ab930809a8 100644 --- a/CRM/Contribute/Form/ManagePremiums.php +++ b/CRM/Contribute/Form/ManagePremiums.php @@ -63,7 +63,7 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { /** * Build the form object. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function buildQuickForm() { parent::buildQuickForm(); diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index eac8152172..90f7c9787a 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -62,7 +62,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { /** * Processing needed for buildForm and later. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function preProcess() { @@ -147,7 +146,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { * Build the form object. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm() { if ($this->isFormInViewOrEditMode()) { @@ -450,7 +448,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { /** * Set the metadata for the form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setSearchMetadata() { $this->addSearchFieldMetadata(['Contribution' => CRM_Contribute_BAO_Query::getSearchFieldMetadata()]); diff --git a/CRM/Contribute/Form/Task/Email.php b/CRM/Contribute/Form/Task/Email.php index da4b638b36..53beab9e15 100644 --- a/CRM/Contribute/Form/Task/Email.php +++ b/CRM/Contribute/Form/Task/Email.php @@ -39,7 +39,6 @@ class CRM_Contribute_Form_Task_Email extends CRM_Contribute_Form_Task { * * @return array * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function getRows(): array { diff --git a/CRM/Contribute/Form/Task/Invoice.php b/CRM/Contribute/Form/Task/Invoice.php index 94c6433252..c2beedce0f 100644 --- a/CRM/Contribute/Form/Task/Invoice.php +++ b/CRM/Contribute/Form/Task/Invoice.php @@ -209,7 +209,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { * @param array $contactIds * Contact Id. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function printPDF($contribIDs, &$params, $contactIds) { // get all the details needed to generate a invoice diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index fe8cf34136..f2a812cee7 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -238,7 +238,7 @@ AND {$this->_componentClause}"; * @return array * array of common elements * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getElements(array $contribIds, array $params, $contactIds, bool $isCreatePDF): array { $pdfElements = []; diff --git a/CRM/Contribute/Form/Task/PDFLetter.php b/CRM/Contribute/Form/Task/PDFLetter.php index a01c6fc8d1..63afe986a4 100644 --- a/CRM/Contribute/Form/Task/PDFLetter.php +++ b/CRM/Contribute/Form/Task/PDFLetter.php @@ -131,7 +131,6 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task { * Process the form after the input has been submitted and validated. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function postProcess() { $formValues = $this->controller->exportValues($this->getName()); @@ -316,7 +315,7 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task { * @param bool $isIncludeSoftCredits * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function buildContributionArray($groupBy, $contributionIDs, $returnProperties, $skipOnHold, $skipDeceased, $messageToken, $task, $separator, $isIncludeSoftCredits) { $contributions = $contacts = []; diff --git a/CRM/Contribute/Form/UpdateSubscription.php b/CRM/Contribute/Form/UpdateSubscription.php index 42f956c33d..5ef8c01903 100644 --- a/CRM/Contribute/Form/UpdateSubscription.php +++ b/CRM/Contribute/Form/UpdateSubscription.php @@ -207,7 +207,6 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib /** * Called after the user submits the form. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function postProcess() { diff --git a/CRM/Contribute/Import/Form/MapField.php b/CRM/Contribute/Import/Form/MapField.php index 543583e334..7c4d85c6ac 100644 --- a/CRM/Contribute/Import/Form/MapField.php +++ b/CRM/Contribute/Import/Form/MapField.php @@ -70,7 +70,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField { /** * Build the form object. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function buildQuickForm(): void { $this->addSavedMappingFields(); diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index f54328ab44..6942283e4f 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -203,7 +203,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { * 'external_identifier' => 'abcd', * 'soft_credit' => [3 => ['external_identifier' => '123', 'soft_credit_type_id' => 1]] * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getMappedRow(array $values): array { $params = []; @@ -334,7 +334,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { * Get a list of entities this import supports. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getImportEntities() : array { $softCreditTypes = ContributionSoft::getFields() @@ -659,7 +659,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { /** * @param int $contributionID * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function deleteExistingSoftCredit(int $contributionID): void { //Delete all existing soft Contribution from contribution_soft table for pcp_id is_null @@ -692,7 +692,6 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { * @return int * Contact ID * - * @throws \API_Exception * @throws \CRM_Core_Exception */ private function lookupMatchingContact(array $params): int { @@ -773,7 +772,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { * @param int $contactID * @param array $noteParams * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function processNote(int $contributionID, int $contactID, array $noteParams): void { $noteParams = array_merge([ diff --git a/CRM/Contribute/Page/Tab.php b/CRM/Contribute/Page/Tab.php index 3cb0cb85bd..b898677d78 100644 --- a/CRM/Contribute/Page/Tab.php +++ b/CRM/Contribute/Page/Tab.php @@ -118,7 +118,6 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { * * @return array|array[] * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function selfServiceRecurLinks(int $recurID): array { $links = []; @@ -184,7 +183,6 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { * * @return array|array[] * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function dashboardRecurLinks(int $recurID, int $contactID): array { $links = []; @@ -413,7 +411,6 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { $context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this); @@ -450,7 +447,6 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { * loads, it decides the which action has to be taken for the page. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function run() { $this->preProcess(); diff --git a/CRM/Contribute/Page/Widget.php b/CRM/Contribute/Page/Widget.php index cf0b71033c..ae51a76d44 100644 --- a/CRM/Contribute/Page/Widget.php +++ b/CRM/Contribute/Page/Widget.php @@ -21,7 +21,6 @@ class CRM_Contribute_Page_Widget extends CRM_Core_Page { * loads, it decides the which action has to be taken for the page. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function run() { $config = CRM_Core_Config::singleton(); diff --git a/CRM/Contribute/WorkflowMessage/Contribution/BasicContribution.php b/CRM/Contribute/WorkflowMessage/Contribution/BasicContribution.php index 0c8e637e62..98f1f3e43c 100644 --- a/CRM/Contribute/WorkflowMessage/Contribution/BasicContribution.php +++ b/CRM/Contribute/WorkflowMessage/Contribution/BasicContribution.php @@ -60,7 +60,7 @@ class CRM_Contribute_WorkflowMessage_Contribution_BasicContribution extends Work * * @param array $example * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function build(array &$example): void { $workFlow = WorkflowMessage::get(TRUE)->addWhere('name', '=', $example['workflow'])->execute()->first(); @@ -107,9 +107,7 @@ class CRM_Contribute_WorkflowMessage_Contribution_BasicContribution extends Work * @param \CRM_Contribute_WorkflowMessage_ContributionOfflineReceipt|\CRM_Contribute_WorkflowMessage_ContributionOnlineReceipt|\CRM_Contribute_WorkflowMessage_ContributionInvoiceReceipt $messageTemplate * @param array $example * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ private function addExampleData(GenericWorkflowMessage $messageTemplate, $example): void { @@ -156,7 +154,7 @@ class CRM_Contribute_WorkflowMessage_Contribution_BasicContribution extends Work * Get a non-quick-config price set. * * @return array|null - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function getNonQuickConfigPriceSet(): ?array { // Permission check defaults to true - likely implicitly OK but may need to be false. @@ -172,7 +170,7 @@ class CRM_Contribute_WorkflowMessage_Contribution_BasicContribution extends Work * @param array|null $priceFieldValue * @param $index * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function setLineItem(CRM_Financial_BAO_Order $mockOrder, $priceField, ?array $priceFieldValue, $index): void { $mockOrder->setLineItem([ diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index 0785fc3907..04c08c59a0 100644 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -319,7 +319,6 @@ FROM civicrm_action_schedule cas * @param string $now * @param array $params * - * @throws API_Exception * @throws \CRM_Core_Exception */ public static function buildRecipientContacts(string $mappingID, $now, $params = []) { @@ -348,7 +347,6 @@ FROM civicrm_action_schedule cas * @param string $now * @param array $params * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function processQueue($now = NULL, $params = []): void { diff --git a/CRM/Core/BAO/Address.php b/CRM/Core/BAO/Address.php index 3159075396..7d81b4a1a4 100644 --- a/CRM/Core/BAO/Address.php +++ b/CRM/Core/BAO/Address.php @@ -1133,7 +1133,7 @@ SELECT is_primary, // create relationship civicrm_api3('relationship', 'create', $relParam); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // We catch and ignore here because this has historically been a best-effort relationship create call. // presumably it could refuse due to duplication or similar and we would ignore that. } diff --git a/CRM/Core/BAO/Block.php b/CRM/Core/BAO/Block.php index 39519b96f9..d508251306 100644 --- a/CRM/Core/BAO/Block.php +++ b/CRM/Core/BAO/Block.php @@ -327,7 +327,7 @@ class CRM_Core_BAO_Block { * @param array $params * @param $class * - * @throws API_Exception + * @throws CRM_Core_Exception */ public static function handlePrimary(&$params, $class) { if (isset($params['id']) && CRM_Utils_System::isNull($params['is_primary'] ?? NULL)) { @@ -336,7 +336,7 @@ class CRM_Core_BAO_Block { } $table = CRM_Core_DAO_AllCoreTables::getTableForClass($class); if (!$table) { - throw new API_Exception("Failed to locate table for class [$class]"); + throw new CRM_Core_Exception("Failed to locate table for class [$class]"); } // contact_id in params might be empty or the string 'null' so cast to integer @@ -409,7 +409,7 @@ class CRM_Core_BAO_Block { * @param array $params * @param $class * - * @throws API_Exception + * @throws CRM_Core_Exception */ public static function handleBilling(&$params, $class) { if (isset($params['id']) && CRM_Utils_System::isNull($params['is_billing'] ?? NULL)) { @@ -418,7 +418,7 @@ class CRM_Core_BAO_Block { } $table = CRM_Core_DAO_AllCoreTables::getTableForClass($class); if (!$table) { - throw new API_Exception("Failed to locate table for class [$class]"); + throw new CRM_Core_Exception("Failed to locate table for class [$class]"); } // contact_id in params might be empty or the string 'null' so cast to integer diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index bfaa1f90d9..b53aae85b8 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -163,7 +163,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @param array $defaults * Default parameters to be be merged into each of the params. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function bulkSave($bulkParams, $defaults = []) { CRM_Core_Error::deprecatedFunctionWarning(__CLASS__ . '::writeRecords'); @@ -753,7 +753,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @param string $label * Label for custom field. * @return \HTML_QuickForm_Element|null - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function addQuickFormElement( $qf, $elementName, $fieldId, $useRequired = TRUE, $search = FALSE, $label = NULL @@ -1246,7 +1246,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { try { $file_description = civicrm_api3('File', 'getvalue', ['return' => "description", 'id' => $value]); } - catch (CiviCRM_API3_Exception $dontcare) { + catch (CRM_Core_Exception $dontcare) { // don't care } @@ -2196,7 +2196,7 @@ WHERE id IN ( %1, %2 ) * @param int[] $fieldIDs * Optional list field ids to move. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception */ public function move($oldContactID, $newContactID, $fieldIDs) { @@ -2473,7 +2473,7 @@ AND default_value IS NOT NULL"; * @param bool $fullString Whether to return "custom_123" or "123" * * @return string|int|null - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getCustomFieldID($fieldName, $groupName = NULL, $fullString = FALSE) { $cacheKey = $groupName . '.' . $fieldName; diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 491da279d0..378c58502c 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1556,7 +1556,7 @@ ORDER BY civicrm_custom_group.weight, * @param string $prefix * Prefix for custom grouptree assigned to template. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function buildQuickForm(&$form, &$groupTree, $inactiveNeeded = FALSE, $prefix = '') { $form->assign_by_ref("{$prefix}groupTree", $groupTree); @@ -1591,7 +1591,6 @@ ORDER BY civicrm_custom_group.weight, * * @return array * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function extractGetParams(&$form, $type) { if (empty($_GET)) { diff --git a/CRM/Core/BAO/Dashboard.php b/CRM/Core/BAO/Dashboard.php index 4e19a85546..82f1b728a4 100644 --- a/CRM/Core/BAO/Dashboard.php +++ b/CRM/Core/BAO/Dashboard.php @@ -42,7 +42,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * * @return array * array of dashlets - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function getContactDashlets(): array { $cid = CRM_Core_Session::getLoggedInContactID(); diff --git a/CRM/Core/BAO/Domain.php b/CRM/Core/BAO/Domain.php index 73d850c1f3..a7bb9a9ace 100644 --- a/CRM/Core/BAO/Domain.php +++ b/CRM/Core/BAO/Domain.php @@ -341,7 +341,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * Return domain information / user information for the usage in receipts * Try default from address then fall back to using logged in user details * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getDefaultReceiptFrom() { $domain = civicrm_api3('domain', 'getsingle', ['id' => CRM_Core_Config::domainID()]); diff --git a/CRM/Core/BAO/Email.php b/CRM/Core/BAO/Email.php index 755f09bd1e..0f5ce64671 100644 --- a/CRM/Core/BAO/Email.php +++ b/CRM/Core/BAO/Email.php @@ -400,7 +400,7 @@ AND reset_date IS NULL * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function getEmailSignatureDefaults(int $emailID): array { diff --git a/CRM/Core/BAO/IM.php b/CRM/Core/BAO/IM.php index a26e6c4ea3..a410e91274 100644 --- a/CRM/Core/BAO/IM.php +++ b/CRM/Core/BAO/IM.php @@ -28,7 +28,6 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { * * @return \CRM_Core_DAO|\CRM_Core_DAO_IM * @throws \CRM_Core_Exception - * @throws \API_Exception */ public static function create($params) { CRM_Core_BAO_Block::handlePrimary($params, __CLASS__); @@ -44,7 +43,6 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { * * @return \CRM_Core_DAO|\CRM_Core_DAO_IM * @throws \CRM_Core_Exception - * @throws \API_Exception */ public static function add($params) { CRM_Core_Error::deprecatedFunctionWarning('use the v4 api'); diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index 0fbe33d61b..a64a2176ab 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -112,13 +112,13 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping implements \Civi\Core\Ho * @return array * Array of mapping names, keyed by id. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getCreateMappingValues($mappingType) { try { return CRM_Core_BAO_Mapping::getMappings($mappingType); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Having a valid mapping_type_id is now enforced. However, rather than error let's // add it. This is required for Multi value which could be done by upgrade script, but // it feels like there could be other instances so this is safer. @@ -227,7 +227,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping implements \Civi\Core\Ho * @param string $fieldName * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getMappingFieldValues($mappingID, $fieldName) { return array_merge(CRM_Utils_Array::collect($fieldName, civicrm_api3('MappingField', 'get', ['mapping_id' => $mappingID, 'return' => $fieldName])['values'])); diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index cd260a29c9..977b91b250 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -65,7 +65,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate implemen * * * @return object - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function add(&$params) { @@ -263,7 +263,6 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate implemen * @return array * Rendered message, consistent of 'subject', 'text', 'html' * Ex: ['subject' => 'Hello Bob', 'text' => 'It\'s been so long since we sent you an automated notification!'] - * @throws \API_Exception * @throws \CRM_Core_Exception * @see sendTemplate() */ @@ -279,7 +278,6 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate implemen * Mixed render parameters. See sendTemplate() for more details. * @return array * Tuple of [$mailContent, $updatedParams]. - * @throws \API_Exception * @throws \CRM_Core_Exception * @see sendTemplate() */ @@ -388,7 +386,6 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate implemen * @return array * Array of four parameters: a boolean whether the email was sent, and the subject, text and HTML templates * @throws \CRM_Core_Exception - * @throws \API_Exception */ public static function sendTemplate(array $params): array { // Handle isEmailPdf here as the unit test on that function deems it 'non-conforming'. @@ -463,7 +460,6 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate implemen * @param string|null $language * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected static function loadTemplate(string $workflowName, bool $isTest, int $messageTemplateID = NULL, $groupName = NULL, ?array $messageTemplateOverride = NULL, ?string $subjectOverride = NULL, ?string $language = NULL): array { diff --git a/CRM/Core/BAO/OpenID.php b/CRM/Core/BAO/OpenID.php index 2b16d2c702..2e1e1576a1 100644 --- a/CRM/Core/BAO/OpenID.php +++ b/CRM/Core/BAO/OpenID.php @@ -28,7 +28,6 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID { * * @return CRM_Core_DAO_OpenID * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function create($params) { @@ -45,7 +44,6 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID { * * @return \CRM_Core_DAO|\CRM_Core_DAO_IM * @throws \CRM_Core_Exception - * @throws \API_Exception */ public static function add($params) { CRM_Core_Error::deprecatedFunctionWarning('use the v4 api'); diff --git a/CRM/Core/BAO/OptionValue.php b/CRM/Core/BAO/OptionValue.php index 2f70600ba3..f7abe94b3a 100644 --- a/CRM/Core/BAO/OptionValue.php +++ b/CRM/Core/BAO/OptionValue.php @@ -132,7 +132,6 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * @return \CRM_Core_DAO_OptionValue * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function add(&$params, $ids = []) { if (!empty($ids['optionValue']) && empty($params['id'])) { diff --git a/CRM/Core/BAO/Phone.php b/CRM/Core/BAO/Phone.php index c51b492bba..3ed91d733b 100644 --- a/CRM/Core/BAO/Phone.php +++ b/CRM/Core/BAO/Phone.php @@ -29,7 +29,6 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone { * * @return \CRM_Core_DAO_Phone * - * @throws API_Exception * @throws \CRM_Core_Exception */ public static function create($params) { @@ -48,7 +47,6 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone { * @return object * CRM_Core_BAO_Phone object on success, null otherwise * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function add($params) { diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php index e848df2edd..9a88d6ec30 100644 --- a/CRM/Core/BAO/PrevNextCache.php +++ b/CRM/Core/BAO/PrevNextCache.php @@ -388,7 +388,6 @@ WHERE (pn.cachekey $op %1 OR pn.cachekey $op %2) * the number of searched contacts, not the matches found. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function refillCache($rgid, $gid, $criteria, $checkPermissions, $searchLimit = 0) { $cacheKeyString = CRM_Dedupe_Merger::getMergeCacheKeyString($rgid, $gid, $criteria, $checkPermissions, $searchLimit); diff --git a/CRM/Core/BAO/Setting.php b/CRM/Core/BAO/Setting.php index 077a1cb0b1..9921e536b7 100644 --- a/CRM/Core/BAO/Setting.php +++ b/CRM/Core/BAO/Setting.php @@ -171,7 +171,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * (required) An api formatted array of keys and values. * @param array|null $domains * - * @throws API_Exception + * @throws CRM_Core_Exception * @domains array an array of domains to get settings for. Default is the current domain * @return array */ @@ -211,7 +211,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * Empty array to be populated with fields metadata. * @param bool $createMode * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * name => value array of the fields to be set (with extraneous removed) */ @@ -253,7 +253,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { $fields = civicrm_api3('setting', 'getfields', $getFieldsParams); $invalidParams = (array_diff_key($settingParams, $fields['values'])); if (!empty($invalidParams)) { - throw new API_Exception(implode(',', array_keys($invalidParams)) . " not valid settings"); + throw new CRM_Core_Exception(implode(',', array_keys($invalidParams)) . " not valid settings"); } if (!empty($settingParams)) { $filteredFields = array_intersect_key($settingParams, $fields['values']); @@ -276,7 +276,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * Deprecated mode * * @return bool - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function validateSetting(&$value, array $fieldSpec, $convertToSerializedString = TRUE) { // Deprecated guesswork - should use $fieldSpec['serialize'] @@ -289,7 +289,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { else { $cb = Civi\Core\Resolver::singleton()->get($fieldSpec['validate_callback']); if (!call_user_func_array($cb, array(&$value, $fieldSpec))) { - throw new API_Exception("validation failed for {$fieldSpec['name']} = $value based on callback {$fieldSpec['validate_callback']}"); + throw new CRM_Core_Exception("validation failed for {$fieldSpec['name']} = $value based on callback {$fieldSpec['validate_callback']}"); } } } @@ -301,11 +301,11 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @param array $fieldSpec Metadata for given field (drawn from the xml) * * @return bool - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function validateBoolSetting(&$value, $fieldSpec) { if (!CRM_Utils_Rule::boolean($value)) { - throw new API_Exception("Boolean value required for {$fieldSpec['name']}"); + throw new CRM_Core_Exception("Boolean value required for {$fieldSpec['name']}"); } if (!$value) { $value = 0; diff --git a/CRM/Core/BAO/Tag.php b/CRM/Core/BAO/Tag.php index 494bd8510b..10541942b0 100644 --- a/CRM/Core/BAO/Tag.php +++ b/CRM/Core/BAO/Tag.php @@ -301,7 +301,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * @param bool $allowSelectingNonSelectable * @param null $exclude * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getColorTags($usedFor = NULL, $allowSelectingNonSelectable = FALSE, $exclude = NULL) { $params = [ diff --git a/CRM/Core/BAO/UFField.php b/CRM/Core/BAO/UFField.php index 3abb2774db..e43bc4a25e 100644 --- a/CRM/Core/BAO/UFField.php +++ b/CRM/Core/BAO/UFField.php @@ -34,7 +34,7 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField { * Array per getfields metadata. * * @return \CRM_Core_BAO_UFField - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function create($params) { $id = $params['id'] ?? NULL; @@ -52,13 +52,13 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField { $params += $defaults; } else { - throw new API_Exception("UFFIeld id {$params['id']} not found."); + throw new CRM_Core_Exception("UFFIeld id {$params['id']} not found."); } } // Validate field_name if (strpos($params['field_name'], 'formatting') !== 0 && !CRM_Core_BAO_UFField::isValidFieldName($params['field_name'])) { - throw new API_Exception('The field_name is not valid'); + throw new CRM_Core_Exception('The field_name is not valid'); } // Supply default label if not set @@ -80,7 +80,7 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField { } if (self::duplicateField($params)) { - throw new API_Exception("The field was not added. It already exists in this profile."); + throw new CRM_Core_Exception("The field was not added. It already exists in this profile."); } //@todo why is this even optional? Surely weight should just be 'managed' ?? diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 063fe93f16..d3fc94a74b 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -3556,7 +3556,7 @@ SELECT group_id * * @return string * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getFrontEndTitle(int $profileID) { $profile = civicrm_api3('UFGroup', 'getsingle', ['id' => $profileID, 'return' => ['title', 'frontend_title']]); diff --git a/CRM/Core/CodeGen/GenerateData.php b/CRM/Core/CodeGen/GenerateData.php index 4117c35759..5e24c1c3fc 100644 --- a/CRM/Core/CodeGen/GenerateData.php +++ b/CRM/Core/CodeGen/GenerateData.php @@ -1135,7 +1135,7 @@ class CRM_Core_CodeGen_GenerateData { /** * This method populates the civicrm_group_contact table * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function addGroup() { // add the 3 groups first @@ -1244,7 +1244,7 @@ class CRM_Core_CodeGen_GenerateData { * * It allows the members of the advisory group to edit the Summer volunteers group. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function addACL(): void { $optionValueID = OptionValue::create(FALSE)->setValues([ diff --git a/CRM/Core/Controller/Task.php b/CRM/Core/Controller/Task.php index 02674c6a40..e4c2e3fe2f 100644 --- a/CRM/Core/Controller/Task.php +++ b/CRM/Core/Controller/Task.php @@ -22,7 +22,6 @@ abstract class CRM_Core_Controller_Task extends CRM_Core_Controller { * @param bool $modal * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 7d91617501..d281675bc3 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -2636,7 +2636,7 @@ SELECT contact_id * Refer to CRM-17454 for information on the danger of querying the information * schema to derive this. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getReferencesToContactTable() { if (isset(\Civi::$statics[__CLASS__]) && isset(\Civi::$statics[__CLASS__]['contact_references'])) { @@ -2707,7 +2707,7 @@ SELECT contact_id * * @param array $cidRefs * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function appendCustomContactReferenceFields(&$cidRefs) { $fields = civicrm_api3('CustomField', 'get', [ diff --git a/CRM/Core/DynamicFKAccessTrait.php b/CRM/Core/DynamicFKAccessTrait.php index d88401b576..ce8b67e755 100644 --- a/CRM/Core/DynamicFKAccessTrait.php +++ b/CRM/Core/DynamicFKAccessTrait.php @@ -40,7 +40,7 @@ trait CRM_Core_DynamicFKAccessTrait { if ($eid && $table) { $targetEntity = CRM_Core_DAO_AllCoreTables::getEntityNameForTable($table); if ($targetEntity === NULL) { - throw new \API_Exception(sprintf('Cannot resolve permissions for dynamic foreign key in "%s". Invalid table reference "%s".', + throw new \CRM_Core_Exception(sprintf('Cannot resolve permissions for dynamic foreign key in "%s". Invalid table reference "%s".', static::getTableName(), $table)); } return \Civi\Api4\Utils\CoreUtil::checkAccessDelegated($targetEntity, 'update', ['id' => $eid], $userID); diff --git a/CRM/Core/EntityTokens.php b/CRM/Core/EntityTokens.php index 8f7866971b..098b1e1ed6 100644 --- a/CRM/Core/EntityTokens.php +++ b/CRM/Core/EntityTokens.php @@ -261,7 +261,7 @@ class CRM_Core_EntityTokens extends AbstractTokenSubscriber { // Tests fail without checkPermissions = FALSE $this->fieldMetadata = (array) civicrm_api4($this->getApiEntityName(), 'getfields', ['checkPermissions' => FALSE], 'name'); } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { $this->fieldMetadata = []; } } @@ -368,7 +368,7 @@ class CRM_Core_EntityTokens extends AbstractTokenSubscriber { * @todo remove this function & use the metadata that is loaded. * * @return string[] - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getBasicTokens(): array { $return = []; @@ -465,7 +465,7 @@ class CRM_Core_EntityTokens extends AbstractTokenSubscriber { * @param \Civi\Token\Event\TokenValueEvent $e * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getPrefetchFields(TokenValueEvent $e): array { $allTokens = array_keys($this->getTokenMetadata()); diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 6d59fd537f..2d5d6c745a 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -1710,7 +1710,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * a controlled way. To convert the field the jcalendar code needs to be removed from the * tpl as well. That file is intended to be EOL. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception * @return mixed * HTML_QuickForm_Element diff --git a/CRM/Core/Form/RecurringEntity.php b/CRM/Core/Form/RecurringEntity.php index e9124dfd40..05435a6aa8 100644 --- a/CRM/Core/Form/RecurringEntity.php +++ b/CRM/Core/Form/RecurringEntity.php @@ -319,7 +319,7 @@ class CRM_Core_Form_RecurringEntity { * @param string $type * @param array $linkedEntities * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function postProcess($params, $type, $linkedEntities = []) { // Check entity_id not present in params take it from class variable diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php index 2af67614c9..001bd72dcd 100644 --- a/CRM/Core/Form/Search.php +++ b/CRM/Core/Form/Search.php @@ -112,7 +112,6 @@ class CRM_Core_Form_Search extends CRM_Core_Form { * Prepare for search by loading options from the url, handling force searches, retrieving form values. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { $this->loadStandardSearchOptionsFromUrl(); @@ -183,7 +182,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { * The goal is to describe all fields in metadata and handle from metadata rather * than existing ad hoc handling. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function addFormFieldsFromMetadata() { $this->addFormRule(['CRM_Core_Form_Search', 'formRule'], $this); @@ -381,7 +380,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { * Note that for translation purposes the full string works better than using 'prefix' hence we use override-able functions * to define the string. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function addSortNameField() { $title = civicrm_api3('setting', 'getvalue', ['name' => 'includeEmailInName', 'group' => 'Search Preferences']) ? $this->getSortNameLabelWithEmail() : $this->getSortNameLabelWithOutEmail(); @@ -426,7 +425,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { /** * Add generic fields that specify the contact. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function addContactSearchFields() { if (!$this->isFormInViewOrEditMode()) { @@ -564,7 +563,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { /** * Set the metadata for the form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setSearchMetadata() {} @@ -574,7 +573,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { * Search field metadata is normally added in buildForm but we are bypassing that in this flow * (I've always found the flow kinda confusing & perhaps that is the problem but this mitigates) * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function handleForcedSearch() { $this->setSearchMetadata(); diff --git a/CRM/Core/Form/Task/PDFLetterCommon.php b/CRM/Core/Form/Task/PDFLetterCommon.php index 0f6e6673ed..e9d32eab6c 100644 --- a/CRM/Core/Form/Task/PDFLetterCommon.php +++ b/CRM/Core/Form/Task/PDFLetterCommon.php @@ -260,7 +260,6 @@ class CRM_Core_Form_Task_PDFLetterCommon { * @deprecated * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function processTemplate(&$formValues) { diff --git a/CRM/Core/ManagedEntities.php b/CRM/Core/ManagedEntities.php index dde799e943..9373d96ff4 100644 --- a/CRM/Core/ManagedEntities.php +++ b/CRM/Core/ManagedEntities.php @@ -274,7 +274,7 @@ class CRM_Core_ManagedEntities { * * @param array $item * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function disableEntity(array $item): void { $entity_type = $item['entity_type']; @@ -489,7 +489,7 @@ class CRM_Core_ManagedEntities { * @param string $entity_type * * @return bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private function isActivationSupported(string $entity_type): bool { if (!isset(Civi::$statics[__CLASS__][__FUNCTION__][$entity_type])) { diff --git a/CRM/Core/Page.php b/CRM/Core/Page.php index a252b99424..806393cead 100644 --- a/CRM/Core/Page.php +++ b/CRM/Core/Page.php @@ -452,7 +452,7 @@ class CRM_Core_Page { * @param string $entity * The entity being queried. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function assignFieldMetadataToTemplate($entity) { $fields = civicrm_api3($entity, 'getfields', ['action' => 'get']); diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 34d6363005..2280a1699f 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -677,7 +677,7 @@ abstract class CRM_Core_Payment { * @return array * Array of payment fields appropriate to the payment processor. * - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ public function getPaymentFormFields() { if ($this->_paymentProcessor['billing_mode'] == 4) { @@ -752,7 +752,7 @@ abstract class CRM_Core_Payment { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getAllFields() { $paymentFields = array_intersect_key($this->getPaymentFormFieldsMetadata(), array_flip($this->getPaymentFormFields())); diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index 79b0585618..f3f050e9f4 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -36,8 +36,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { * * @return bool|void * - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function main() { try { @@ -109,7 +108,6 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { * * @return bool * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function recur($input, $recur, $contribution, $first) { @@ -300,9 +298,7 @@ INNER JOIN civicrm_contribution co ON co.contribution_recur_id = cr.id * * @return int * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function getPaymentProcessorID(): int { // Attempt to get payment processor ID from URL diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index b21f4fa519..09cf856237 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -72,7 +72,7 @@ class CRM_Core_Payment_BaseIPN { * @deprecated use the api. * * @return bool - * @throws \CiviCRM_API3_Exception|\CRM_Core_Exception + * @throws \CRM_Core_Exception */ public function failed($objects) { CRM_Core_Error::deprecatedFunctionWarning('use the api'); @@ -141,7 +141,7 @@ class CRM_Core_Payment_BaseIPN { * @param array $objects * * @return bool - * @throws \CiviCRM_API3_Exception|\CRM_Core_Exception + * @throws \CRM_Core_Exception */ public function cancelled($objects) { CRM_Core_Error::deprecatedFunctionWarning('Use Contribution create api to cancel the contribution'); @@ -221,7 +221,7 @@ class CRM_Core_Payment_BaseIPN { * * @param $participantID * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private function cancelParticipant($participantID) { // @fixme https://lab.civicrm.org/dev/core/issues/927 Cancelling membership etc is not desirable for all use-cases and we should be able to disable it @@ -303,7 +303,7 @@ class CRM_Core_Payment_BaseIPN { * // @todo check if it is a repeat transaction & call repeattransaction instead. * civicrm_api3('contribution', 'completetransaction', array('id' => $this->transaction_id)); * } - * catch (CiviCRM_API3_Exception $e) { + * catch (CRM_Core_Exception $e) { * if (!stristr($e->getMessage(), 'Contribution already completed')) { * $this->handleError('error', $this->transaction_id . $e->getMessage(), 'ipn_completion', 9000, 'An error may * have occurred. Please check your receipt is correct'); @@ -319,7 +319,6 @@ class CRM_Core_Payment_BaseIPN { * @param array $objects * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function completeTransaction($input, $ids, $objects) { CRM_Core_Error::deprecatedFunctionWarning('Use Payment.create api'); @@ -359,7 +358,7 @@ class CRM_Core_Payment_BaseIPN { * Related object IDs. * @param array $objects * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function sendMail($input, $ids, $objects) { CRM_Core_Error::deprecatedFunctionWarning('this should be done via completetransaction api'); diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index fc0b5f7bc1..6dd2acae1b 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -67,7 +67,6 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { * @return void * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function recur($input, $recur, $contribution, $first) { @@ -169,7 +168,6 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { * * @return void * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function single($input, $contribution, $recur = FALSE) { @@ -205,8 +203,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { /** * Main function. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function main() { @@ -332,7 +329,6 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { * * @return int * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function getPayPalPaymentProcessorID(array $input, ?int $contributionRecurID): int { // First we try and retrieve from POST params diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 1420b32600..f0b79177f8 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -773,7 +773,6 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * Process incoming notification. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function handlePaymentNotification() { $params = array_merge($_GET, $_REQUEST); diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index e78b4bdbad..4dc98b5c31 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -222,9 +222,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { * * @param array $input * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function recur(array $input): void { @@ -339,9 +337,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { * @param array $input * * @return void - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function single(array $input): void { @@ -510,9 +506,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { * but let's assume knowledge on invoice id & schedule is enough for now esp * for donations only contribute is handled * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function handlePaymentExpress(): void { $input = ['invoice' => $this->getValue('i', FALSE)]; diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index e5a837f934..5490d0562a 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -1094,7 +1094,7 @@ class CRM_Core_SelectValues { * Dropdown options for quicksearch in the menu * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function quicksearchOptions() { $includeEmail = civicrm_api3('setting', 'getvalue', ['name' => 'includeEmailInName', 'group' => 'Search Preferences']); diff --git a/CRM/Core/Session.php b/CRM/Core/Session.php index 57939665f4..f1edba8947 100644 --- a/CRM/Core/Session.php +++ b/CRM/Core/Session.php @@ -563,7 +563,7 @@ class CRM_Core_Session { * * @return string * - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ public function getLoggedInContactDisplayName() { $userContactID = CRM_Core_Session::getLoggedInContactID(); diff --git a/CRM/Custom/Import/Parser/Api.php b/CRM/Custom/Import/Parser/Api.php index 1c1ec51efb..721113fc2e 100644 --- a/CRM/Custom/Import/Parser/Api.php +++ b/CRM/Custom/Import/Parser/Api.php @@ -67,7 +67,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Import_Parser { civicrm_api3('custom_value', 'create', $params); $this->setImportStatus($rowNumber, 'IMPORTED', '', $formatted['id']); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { $this->setImportStatus($rowNumber, 'ERROR', '', $e->getMessage()); } } diff --git a/CRM/Dedupe/BAO/DedupeRule.php b/CRM/Dedupe/BAO/DedupeRule.php index ab12b8ffd2..368a35b507 100644 --- a/CRM/Dedupe/BAO/DedupeRule.php +++ b/CRM/Dedupe/BAO/DedupeRule.php @@ -42,7 +42,6 @@ class CRM_Dedupe_BAO_DedupeRule extends CRM_Dedupe_DAO_DedupeRule { * or NULL if params is present and doesn't have and for a field. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function sql() { if ($this->params && @@ -228,7 +227,7 @@ class CRM_Dedupe_BAO_DedupeRule extends CRM_Dedupe_DAO_DedupeRule { * @param string $fieldName * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getFieldType($fieldName) { $entity = CRM_Core_DAO_AllCoreTables::getEntityNameForTable($this->rule_table); diff --git a/CRM/Dedupe/MergeHandler.php b/CRM/Dedupe/MergeHandler.php index b6a58b886a..79c296fdcc 100644 --- a/CRM/Dedupe/MergeHandler.php +++ b/CRM/Dedupe/MergeHandler.php @@ -377,7 +377,6 @@ class CRM_Dedupe_MergeHandler { * The use of the new hook is tested, including the fact it is called before contributions are merged, as this * is likely to be significant data in merge hooks. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function mergeLocations(): void { diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 028e13cde8..9dfec97e9f 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -24,7 +24,7 @@ class CRM_Dedupe_Merger { * be loaded dynamically on the merge form instead * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function relTables() { @@ -178,7 +178,7 @@ class CRM_Dedupe_Merger { * @param int $cid * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getActiveRelTables($cid) { $cid = (int) $cid; @@ -283,7 +283,7 @@ class CRM_Dedupe_Merger { * 'relTables' or 'cidRefs'. * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @see CRM-13836 */ public static function getMultiValueCustomSets($request) { @@ -459,7 +459,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @param int $otherID * @param array $tables * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function removeContactBelongings($otherID, $tables) { // CRM-20421: Removing Inherited memberships when memberships of parent are not migrated to new contact. @@ -490,8 +490,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @param array $tables * @param array $tableOperations * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function moveContactBelongings($mergeHandler, $tables, $tableOperations) { @@ -625,7 +624,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * * @param array $cidRefs * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected static function filterRowBasedCustomDataFromCustomTables(array &$cidRefs) { @@ -680,7 +679,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @param array $params * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected static function updateContact(int $contactID, $params): void { @@ -1105,8 +1103,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @return array|bool * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public static function batchMerge($rgid, $gid = NULL, $mode = 'safe', $batchLimit = 1, $isSelected = 2, $criteria = [], $checkPermissions = TRUE, $reloadCacheIfEmpty = NULL, $searchLimit = 0) { $redirectForPerformance = $batchLimit > 1; @@ -1169,7 +1165,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @param string $cacheKeyString * @param array $result * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function updateMergeStats($cacheKeyString, $result = []) { // gather latest stats @@ -1221,7 +1217,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @return array * Array of how many were merged and how many were skipped. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getMergeStats($cacheKeyString) { $stats = civicrm_api3('Dedupe', 'get', ['cachekey' => "{$cacheKeyString}_stats", 'sequential' => 1])['values']; @@ -1276,9 +1272,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * * @return array|bool * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function merge($dupePairs = [], $cacheParams = [], $mode = 'safe', $redirectForPerformance = FALSE, $checkPermissions = TRUE @@ -1354,8 +1348,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @return bool * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public static function skipMerge($mainId, $otherId, &$migrationInfo, $mode = 'safe', &$conflicts = []) { @@ -1513,7 +1505,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * though the form had been submitted with those options. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function getRowsElementsAndInfo($mainId, $otherId, $checkPermissions = TRUE) { $qfZeroBug = 'e8cddb72-a257-11dc-b9cc-0016d3330ee9'; @@ -1699,9 +1690,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * * @return bool * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public static function moveAllBelongings($mainId, $otherId, $migrationInfo, $checkPermissions = TRUE) { @@ -1915,7 +1904,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @param int $contactID * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function addMembershipToRelatedContacts($contactID) { $dao = new CRM_Member_DAO_Membership(); @@ -1949,7 +1937,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @param int $mainId * @param int $otherId * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function createMergeActivities($mainId, $otherId) { $params = [ @@ -2007,7 +1995,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * Array of matches meeting the criteria. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function getDuplicatePairs($rule_group_id, $group_id, $reloadCacheIfEmpty, $batchLimit, $isSelected, $includeConflicts = TRUE, $criteria = [], $checkPermissions = TRUE, $searchLimit = 0, $isForceNewSearch = 0) { $dupePairs = $isForceNewSearch ? [] : self::getCachedDuplicateMatches($rule_group_id, $group_id, $batchLimit, $isSelected, $includeConflicts, $criteria, $checkPermissions, $searchLimit); @@ -2120,10 +2107,9 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @param string $cacheKeyString * * @return bool|array - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \CRM_Core_Exception_ResourceConflictException - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected static function dedupePair(int $mainId, int $otherId, $mode = 'safe', $checkPermissions = TRUE, $cacheKeyString = NULL) { @@ -2349,7 +2335,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @return array * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function getConflicts(array &$migrationInfo, int $mainId, int $otherId, string $mode): array { $conflicts = []; @@ -2631,7 +2616,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private static function buildLocationBlockForContact($cid, $blockInfo, $blockName): array { $searchParams = [ @@ -2733,7 +2718,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @param array $migrationInfo * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected static function addLocationFieldInfo($mainId, $otherId, $blockInfo, $blockName, array $locations, array $rows, array $elements, array $migrationInfo): array { // Collect existing fields from both 'main' and 'other' contacts first diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 9f12eeff0d..df9bd6760a 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -327,7 +327,7 @@ WHERE ( civicrm_event.is_template IS NULL OR civicrm_event.is_template = 0 )"; * @return array * Array of event summary values * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getEventSummary() { $eventSummary = $eventIds = []; @@ -1064,7 +1064,7 @@ WHERE civicrm_event.is_active = 1 * @param bool $returnMessageText * * @return array|null - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function sendMail($contactID, $values, $participantId, $isTest = FALSE, $returnMessageText = FALSE) { @@ -1470,8 +1470,6 @@ WHERE civicrm_event.is_active = 1 * @param array $profileFields * * @throws \CRM_Core_Exception - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception */ public static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$profileFields = []) { if ($gid) { @@ -2051,7 +2049,7 @@ WHERE ce.loc_block_id = $locBlockId"; * * @return bool|array * Whether the user has permission for this event (or if eventId=NULL an array of permissions) - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function checkPermission(int $eventId, $permissionType = CRM_Core_Permission::VIEW) { switch ($permissionType) { @@ -2121,7 +2119,7 @@ WHERE ce.loc_block_id = $locBlockId"; * @param int $eventId * * @return array $allEvents, $createdEvents - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private static function checkPermissionGetInfo($eventId = NULL) { $params = [ @@ -2154,7 +2152,7 @@ WHERE ce.loc_block_id = $locBlockId"; * * @return array * Array of events with permissions (array_keys=permissions) - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getAllPermissions() { if (!isset(Civi::$statics[__CLASS__]['permissions'])) { diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 96daf54a23..e67401c82a 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -959,7 +959,7 @@ WHERE civicrm_participant.id = {$participantId} * Get the ID of the default (first) participant role * * @return int - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getDefaultRoleID() { return (int) civicrm_api3('OptionValue', 'getvalue', [ @@ -1110,7 +1110,7 @@ WHERE cpf.price_set_id = %1 AND cpfv.label LIKE %2"; } return TRUE; } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { throw new CRM_Core_Exception('Failed to update additional participant status in database'); } } diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index 4e53555e3a..4b5e7c18f1 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -568,7 +568,7 @@ class CRM_Event_BAO_Query extends CRM_Core_BAO_Query { /** * Get the metadata for fields to be included on the grant search form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getSearchFieldMetadata() { $fields = [ @@ -587,7 +587,6 @@ class CRM_Event_BAO_Query extends CRM_Core_BAO_Query { * * @param \CRM_Event_Form_Search $form * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public static function buildSearchForm(&$form) { diff --git a/CRM/Event/Form/ManageEvent/Delete.php b/CRM/Event/Form/ManageEvent/Delete.php index f6a5e7207b..6260b2639a 100644 --- a/CRM/Event/Form/ManageEvent/Delete.php +++ b/CRM/Event/Form/ManageEvent/Delete.php @@ -30,7 +30,6 @@ class CRM_Event_Form_ManageEvent_Delete extends CRM_Event_Form_ManageEvent { /** * Set variables up before form is built. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function preProcess() { diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index a81f025368..7fe919029e 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -265,7 +265,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * Set variables up before form is built. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { parent::preProcess(); @@ -580,7 +579,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * * @return void * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm() { @@ -972,7 +970,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * * @return string * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function submit($params) { if ($this->_mode && !$this->_isPaidEvent) { @@ -1782,7 +1779,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function preparePaidEventProcessing($params): array { $participantStatus = CRM_Event_PseudoConstant::participantStatus(); @@ -1938,7 +1935,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * @return \CRM_Contribute_BAO_Contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function processContribution( &$form, $params, $result, $contactID, @@ -2040,7 +2036,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * * @return \CRM_Event_BAO_Participant * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function addParticipant(&$form, $params, $contactID) { $transaction = new CRM_Core_Transaction(); @@ -2124,7 +2119,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * @param string $fieldName * * @return mixed - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getEventValue(string $fieldName) { if (!isset($this->_event)) { @@ -2139,7 +2134,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * @param string $fieldName * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getParticipantValue($fieldName) { if (!$this->participantRecord) { @@ -2162,7 +2157,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * * @return string * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getRevenueRecognitionDate() { if (Civi::settings()->get('deferred_revenue_enabled')) { diff --git a/CRM/Event/Form/ParticipantFeeSelection.php b/CRM/Event/Form/ParticipantFeeSelection.php index 51dc2e32d5..6160faf18d 100644 --- a/CRM/Event/Form/ParticipantFeeSelection.php +++ b/CRM/Event/Form/ParticipantFeeSelection.php @@ -225,7 +225,6 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form { * Post process form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function postProcess() { $params = $this->controller->exportValues($this->_name); diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index f2f5e25831..9c751106b4 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -640,7 +640,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { * @param int $contactID * @param \CRM_Contribute_BAO_Contribution $contribution * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function confirmPostProcess($contactID = NULL, $contribution = NULL) { // add/update contact information @@ -733,7 +733,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { * @param int $contactID * * @return \CRM_Event_BAO_Participant - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function addParticipant(&$form, $contactID) { if (empty($form->_params)) { @@ -1444,7 +1444,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { * Form values. * @param int $contactID * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function processRegistration($params, $contactID = NULL) { $session = CRM_Core_Session::singleton(); @@ -1565,7 +1565,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { * @param $registerByID * @param array $participantCount * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private function sendMails($params, $registerByID, array $participantCount) { $isTest = FALSE; diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index c91e89a443..371a2b9242 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -365,7 +365,6 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { /** * Process the form submission. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function postProcess() { @@ -889,7 +888,6 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { * @return \CRM_Contribute_BAO_Contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ private function processContribution( $params, $result, $contactID, diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index dac1326ab8..8b0b026349 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -206,7 +206,6 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * @return array * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setDefaultValues() { $this->_defaults = []; diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index 0c2ce4dbf5..7a2c720416 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -76,7 +76,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { * @return void * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { // SearchFormName is deprecated & to be removed - the replacement is for the task to @@ -129,7 +128,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { * @return void * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm() { parent::buildQuickForm(); @@ -426,7 +424,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { /** * Set the metadata for the form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setSearchMetadata() { $this->addSearchFieldMetadata(['Participant' => CRM_Event_BAO_Query::getSearchFieldMetadata()]); diff --git a/CRM/Event/Form/SelfSvcTransfer.php b/CRM/Event/Form/SelfSvcTransfer.php index 75ab966ebc..4f22bfe0ea 100644 --- a/CRM/Event/Form/SelfSvcTransfer.php +++ b/CRM/Event/Form/SelfSvcTransfer.php @@ -298,7 +298,7 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form { * Process transfer - first add the new participant to the event, then cancel * source participant - send confirmation email to transferee * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function postProcess() { //For transfer, process form to allow selection of transferree @@ -344,9 +344,7 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form { * * @param CRM_Event_BAO_Participant $participant * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function participantTransfer($participant): void { $contactDetails = civicrm_api3('Contact', 'getsingle', ['id' => $participant->contact_id, 'return' => ['display_name', 'email']]); @@ -465,7 +463,6 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form { * @param int $fromParticipantID * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function transferParticipantRegistration($toContactID, $fromParticipantID) { $toParticipantValues = \Civi\Api4\Participant::get() diff --git a/CRM/Event/Form/Task.php b/CRM/Event/Form/Task.php index a23da4c6b5..45c7f882bd 100644 --- a/CRM/Event/Form/Task.php +++ b/CRM/Event/Form/Task.php @@ -156,7 +156,7 @@ class CRM_Event_Form_Task extends CRM_Core_Form_Task { /** * Get the rows form the search, keyed to make the token processor happy. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getRows(): array { if (empty($this->rows)) { diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index 8e45031d14..1ad9609ef0 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -261,7 +261,6 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { * @param int $statusId * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function updatePendingOnlineContribution($participantId, $statusId) { @@ -303,7 +302,6 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { * @param array $params * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Exception * * @deprecated @@ -381,7 +379,6 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { * @param array $params * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function submit($params) { $statusClasses = CRM_Event_PseudoConstant::participantStatusClass(); diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index 7d3e02d54b..534f8de42e 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -402,7 +402,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { * * @return array|bool * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @deprecated - this is part of the import parser not the API & needs to be * moved on out * diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index a39eb17a6a..57a620ec1b 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -123,7 +123,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { * * @return array * (reference) of tab links - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function &tabs() { // @todo Move to eventcart extension diff --git a/CRM/Event/ParticipantTokens.php b/CRM/Event/ParticipantTokens.php index b29050fcf1..8fb62af630 100644 --- a/CRM/Event/ParticipantTokens.php +++ b/CRM/Event/ParticipantTokens.php @@ -61,7 +61,7 @@ class CRM_Event_ParticipantTokens extends CRM_Core_EntityTokens { /** * @inheritDoc - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function evaluateToken(TokenRow $row, $entity, $field, $prefetch = NULL) { $this->prefetch = (array) $prefetch; diff --git a/CRM/Event/Tokens.php b/CRM/Event/Tokens.php index 194ae13dbd..3ac471ad17 100644 --- a/CRM/Event/Tokens.php +++ b/CRM/Event/Tokens.php @@ -88,7 +88,7 @@ class CRM_Event_Tokens extends CRM_Core_EntityTokens { /** * @inheritDoc - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function evaluateToken(TokenRow $row, $entity, $field, $prefetch = NULL) { $eventID = $this->getFieldValue($row, 'id'); @@ -108,7 +108,7 @@ class CRM_Event_Tokens extends CRM_Core_EntityTokens { * * @return array * - * @throws \API_Exception|\CRM_Core_Exception + * @throws \CRM_Core_Exception * * @internal */ diff --git a/CRM/Event/WorkflowMessage/EventExamples.php b/CRM/Event/WorkflowMessage/EventExamples.php index 68de53d91d..8524413ab0 100644 --- a/CRM/Event/WorkflowMessage/EventExamples.php +++ b/CRM/Event/WorkflowMessage/EventExamples.php @@ -15,7 +15,7 @@ class CRM_Event_WorkflowMessage_EventExamples extends WorkflowMessageExample { /** * Get the examples this class is able to deliver. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getExamples(): iterable { $workflows = ['event_online_receipt', 'event_offline_receipt']; @@ -39,7 +39,7 @@ class CRM_Event_WorkflowMessage_EventExamples extends WorkflowMessageExample { * * @param array $example * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function build(array &$example): void { $workFlow = WorkflowMessage::get(TRUE)->addWhere('name', '=', $example['workflow'])->execute()->first(); @@ -55,9 +55,7 @@ class CRM_Event_WorkflowMessage_EventExamples extends WorkflowMessageExample { * @param \CRM_Event_WorkflowMessage_EventOnlineReceipt|\CRM_Event_WorkflowMessage_EventOfflineReceipt $messageTemplate * @param array $example * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ private function addExampleData(GenericWorkflowMessage $messageTemplate, $example): void { @@ -70,7 +68,7 @@ class CRM_Event_WorkflowMessage_EventExamples extends WorkflowMessageExample { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function getPriceSets(): ?array { // Permission check defaults to true - likely implicitly OK but may need to be false. @@ -86,7 +84,7 @@ class CRM_Event_WorkflowMessage_EventExamples extends WorkflowMessageExample { * @param bool $isQuickConfig * * @return array|null - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function getPriceSet(bool $isQuickConfig): ?array { $priceSetEntity = PriceSetEntity::get(FALSE) diff --git a/CRM/Export/BAO/ExportProcessor.php b/CRM/Export/BAO/ExportProcessor.php index 263931c27b..97bdcc708c 100644 --- a/CRM/Export/BAO/ExportProcessor.php +++ b/CRM/Export/BAO/ExportProcessor.php @@ -1088,7 +1088,6 @@ class CRM_Export_BAO_ExportProcessor { * * @return string * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function getTransformedFieldValue($field, $iterationDAO, $fieldValue, $paymentDetails) { @@ -1875,7 +1874,6 @@ class CRM_Export_BAO_ExportProcessor { * @param int $contactID * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function replaceMergeTokens(int $contactID): array { diff --git a/CRM/Export/Utils.php b/CRM/Export/Utils.php index adfed821b3..be4258dcba 100644 --- a/CRM/Export/Utils.php +++ b/CRM/Export/Utils.php @@ -16,7 +16,7 @@ class CRM_Export_Utils { * * @param $exportMode * @return array - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ public static function getExportFields($exportMode) { $fieldGroups = CRM_Core_BAO_Mapping::getBasicFields('Export'); diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php index fa9c0e9ee2..0356899989 100644 --- a/CRM/Financial/BAO/FinancialType.php +++ b/CRM/Financial/BAO/FinancialType.php @@ -172,7 +172,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType im * @return array * all financial type with income account is relationship * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function getIncomeFinancialType($checkPermissions = TRUE): array { // Realistically tests are the only place where logged in contact can diff --git a/CRM/Financial/BAO/FinancialTypeAccount.php b/CRM/Financial/BAO/FinancialTypeAccount.php index dd3be4a4ef..a3b8bbfecb 100644 --- a/CRM/Financial/BAO/FinancialTypeAccount.php +++ b/CRM/Financial/BAO/FinancialTypeAccount.php @@ -137,7 +137,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin * Payment instrument value. * * @return null|int - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getInstrumentFinancialAccount($paymentInstrumentValue) { if (!isset(\Civi::$statics[__CLASS__]['instrument_financial_accounts'][$paymentInstrumentValue])) { diff --git a/CRM/Financial/BAO/Order.php b/CRM/Financial/BAO/Order.php index 941f65e9e4..a2ae54e8c3 100644 --- a/CRM/Financial/BAO/Order.php +++ b/CRM/Financial/BAO/Order.php @@ -451,7 +451,7 @@ class CRM_Financial_BAO_Order { * * @return int * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getPriceSetID(): int { if (!$this->priceSetID) { @@ -478,7 +478,7 @@ class CRM_Financial_BAO_Order { * * @param string $component [membership|contribution] * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @internal use in tested core code only. */ public function setPriceSetToDefault(string $component): void { @@ -504,7 +504,7 @@ class CRM_Financial_BAO_Order { * * @param int $eventID * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setPriceSetIDByEventPageID(int $eventID): void { $this->setPriceSetIDByEntity('event', $eventID); @@ -681,7 +681,7 @@ class CRM_Financial_BAO_Order { * * @param array $input * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function setPriceSelectionFromUnfilteredInput(array $input): void { foreach ($input as $fieldName => $value) { @@ -702,7 +702,7 @@ class CRM_Financial_BAO_Order { /** * Get the id of the price field to use when just an amount is provided. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * * @return int */ @@ -719,7 +719,7 @@ class CRM_Financial_BAO_Order { /** * Get the id of the price field to use when just an amount is provided. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * * @return int */ @@ -738,7 +738,7 @@ class CRM_Financial_BAO_Order { * * return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getLineItems():array { if (empty($this->lineItems)) { @@ -753,7 +753,7 @@ class CRM_Financial_BAO_Order { * This ensures the line items are indexed by * price field id - as required by the contribution BAO. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getPriceFieldIndexedLineItems(): array { $lines = []; @@ -768,7 +768,7 @@ class CRM_Financial_BAO_Order { * * return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getMembershipLineItems():array { $lines = $this->getLineItems(); @@ -789,7 +789,7 @@ class CRM_Financial_BAO_Order { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getMembershipTypes(): array { $types = []; @@ -804,7 +804,7 @@ class CRM_Financial_BAO_Order { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getRenewableMembershipTypes(): array { $types = []; @@ -819,7 +819,7 @@ class CRM_Financial_BAO_Order { /** * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function calculateLineItems(): array { $lineItems = []; @@ -885,7 +885,7 @@ class CRM_Financial_BAO_Order { * * @return float * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getTotalTaxAmount() :float { $amount = 0.0; @@ -900,7 +900,7 @@ class CRM_Financial_BAO_Order { * * @return float * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getTotalAmount() :float { $amount = 0.0; @@ -915,7 +915,7 @@ class CRM_Financial_BAO_Order { * * @return float * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getMembershipTotalAmount() :float { $amount = 0.0; @@ -943,7 +943,7 @@ class CRM_Financial_BAO_Order { /** * @param $fieldID * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function setPriceSetIDFromSelectedField($fieldID): void { if (!isset($this->priceSetID)) { @@ -966,7 +966,7 @@ class CRM_Financial_BAO_Order { * @param array $lineItem * @param int|string $index * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @internal tested core code usage only. * @internal use in tested core code only. * @@ -1124,7 +1124,7 @@ class CRM_Financial_BAO_Order { * * @return \Civi\Api4\Generic\Result * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getLinesFromTemplateContribution(): array { $lines = $this->getLinesForContribution(); @@ -1143,7 +1143,7 @@ class CRM_Financial_BAO_Order { * * @internal core tested code only. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getLineItemForV3OrderApi(): array { $lineItems = []; @@ -1158,7 +1158,7 @@ class CRM_Financial_BAO_Order { /** * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function getLinesForContribution(): array { @@ -1191,7 +1191,7 @@ class CRM_Financial_BAO_Order { * @param string $component * * @return int - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getDefaultPriceSetForComponent(string $component): int { if (!isset($this->defaultPriceSets[$component])) { @@ -1208,7 +1208,7 @@ class CRM_Financial_BAO_Order { * * @param array $lineItem * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function fillDefaultContributionLine(array &$lineItem): void { $defaults = [ diff --git a/CRM/Financial/BAO/Payment.php b/CRM/Financial/BAO/Payment.php index 17b03cec0f..f3fdfdadc0 100644 --- a/CRM/Financial/BAO/Payment.php +++ b/CRM/Financial/BAO/Payment.php @@ -38,8 +38,6 @@ class CRM_Financial_BAO_Payment { * @return \CRM_Financial_DAO_FinancialTrxn * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public static function create(array $params): CRM_Financial_DAO_FinancialTrxn { $contribution = civicrm_api3('Contribution', 'getsingle', ['id' => $params['contribution_id']]); @@ -227,7 +225,7 @@ class CRM_Financial_BAO_Payment { * @param array $params * @param int $contributionID * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function updateRelatedContribution(array $params, int $contributionID): void { $contributionDAO = new CRM_Contribute_DAO_Contribution(); @@ -273,7 +271,7 @@ class CRM_Financial_BAO_Payment { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function sendConfirmation($params) { @@ -331,7 +329,7 @@ class CRM_Financial_BAO_Payment { * - event = [.... full event details......] * - contribution = ['id' => x], * - payment = [payment info + payment summary info] - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected static function loadRelatedEntities($id) { $entities = []; @@ -374,8 +372,7 @@ class CRM_Financial_BAO_Payment { * @param int $contributionID * * @return int - * @throws \CiviCRM_API3_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getPaymentContactID($contributionID) { $contribution = civicrm_api3('Contribution', 'getsingle', [ @@ -497,7 +494,7 @@ class CRM_Financial_BAO_Payment { * @param int $contributionID * @param string $status * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private static function updateContributionStatus(int $contributionID, string $status) { civicrm_api3('Contribution', 'create', @@ -523,7 +520,7 @@ class CRM_Financial_BAO_Payment { * @param $params * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected static function getPayableLineItems($params): array { $lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($params['contribution_id']); @@ -573,7 +570,7 @@ class CRM_Financial_BAO_Payment { * * @return float * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected static function getAmountOfLineItemPaid($lineItemID) { $paid = 0; @@ -604,7 +601,7 @@ class CRM_Financial_BAO_Payment { * @param array $params * @param int $trxnID * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected static function reverseAllocationsFromPreviousPayment($params, $trxnID) { // Do a direct reversal of any entity_financial_trxn records being cancelled. @@ -647,7 +644,7 @@ class CRM_Financial_BAO_Payment { * * @return int * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected static function getNewFinancialItemID($lineItem, $trxn_date, $contactID, $currency): int { $financialAccount = CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship( diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index 53fad03959..332002ce24 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -34,7 +34,6 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @return CRM_Financial_DAO_PaymentProcessor * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function create(array $params): CRM_Financial_DAO_PaymentProcessor { // If we are creating a new PaymentProcessor and have not specified the payment instrument to use, get the default from the Payment Processor Type. @@ -272,7 +271,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @param bool|null $isActive * Do we only want active processors, only inactive (FALSE) or all processors (NULL) * - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception * @return array */ public static function getAllPaymentProcessors($mode = 'all', $reset = FALSE, $isCurrentDomainOnly = TRUE, $isActive = TRUE) { @@ -374,7 +373,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @return array * available processors * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getPaymentProcessors($capabilities = [], $ids = FALSE) { if (is_array($ids)) { @@ -545,7 +544,7 @@ INNER JOIN civicrm_contribution con ON ( mp.contribution_id = con.id ) try { $paymentProcessor = civicrm_api3('PaymentProcessor', 'getsingle', ['id' => $ppID]); } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { // Unable to load the processor because this function uses an unreliable method to derive it. // The function looks to load the payment processor ID from the contribution page, which // can support multiple processors. diff --git a/CRM/Financial/Form/FinancialType.php b/CRM/Financial/Form/FinancialType.php index 5dc3100dd9..9d1c0fdfb6 100644 --- a/CRM/Financial/Form/FinancialType.php +++ b/CRM/Financial/Form/FinancialType.php @@ -113,7 +113,7 @@ class CRM_Financial_Form_FinancialType extends CRM_Core_Form { /** * Process the form submission. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function postProcess() { if ($this->_action & CRM_Core_Action::DELETE) { diff --git a/CRM/Financial/Form/PaymentEdit.php b/CRM/Financial/Form/PaymentEdit.php index afa6bd745c..9f0cae2437 100644 --- a/CRM/Financial/Form/PaymentEdit.php +++ b/CRM/Financial/Form/PaymentEdit.php @@ -161,7 +161,7 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form { /** * Process the form submission. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function postProcess(): void { $params = [ @@ -195,7 +195,7 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form { * * @param array $submittedValues * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function submit($submittedValues) { // if payment instrument is changed then @@ -229,7 +229,7 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form { * * @param array $params * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testSubmit(array $params): void { $this->_id = $params['id']; diff --git a/CRM/Financial/Page/AJAX.php b/CRM/Financial/Page/AJAX.php index 66d65ee1dc..08d7e33dff 100644 --- a/CRM/Financial/Page/AJAX.php +++ b/CRM/Financial/Page/AJAX.php @@ -503,7 +503,6 @@ class CRM_Financial_Page_AJAX { } /** - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function getBatchSummary(): void { @@ -516,7 +515,6 @@ class CRM_Financial_Page_AJAX { * @param $batchID * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function makeBatchSummary(int $batchID): array { diff --git a/CRM/Import/DataSource.php b/CRM/Import/DataSource.php index e592c5a906..f75a419b34 100644 --- a/CRM/Import/DataSource.php +++ b/CRM/Import/DataSource.php @@ -200,7 +200,7 @@ abstract class CRM_Import_DataSource { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getUserJob(): array { if (!$this->userJob) { @@ -219,7 +219,7 @@ abstract class CRM_Import_DataSource { * * @return mixed * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getSubmittedValue(string $valueName) { return $this->getUserJob()['metadata']['submitted_values'][$valueName]; @@ -235,7 +235,6 @@ abstract class CRM_Import_DataSource { * * @return array * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function getRows(bool $nonAssociative = TRUE): array { @@ -252,7 +251,6 @@ abstract class CRM_Import_DataSource { * Get the next row. * * @return array|null - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function getRow(): ?array { @@ -298,7 +296,7 @@ abstract class CRM_Import_DataSource { * that can see what fields they are mapping. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getColumnHeaders(): array { return $this->getUserJob()['metadata']['DataSource']['column_headers']; @@ -308,7 +306,6 @@ abstract class CRM_Import_DataSource { * Get the field names of the fields holding data in the import tracking table. * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function getDataFieldNames(): array { @@ -332,7 +329,7 @@ abstract class CRM_Import_DataSource { * that can see what fields they are mapping. * * @return int - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getNumberOfColumns(): int { return $this->getUserJob()['metadata']['DataSource']['number_of_columns']; @@ -359,7 +356,7 @@ abstract class CRM_Import_DataSource { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getDataSourceMetadata(): array { if (!$this->dataSourceMetadata && $this->getUserJobID()) { @@ -374,7 +371,6 @@ abstract class CRM_Import_DataSource { * * @return string|null * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function getTableName(): ?string { @@ -433,7 +429,6 @@ abstract class CRM_Import_DataSource { /** * Initialize the datasource, based on the submitted values stored in the user job. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function initialize(): void { @@ -454,7 +449,7 @@ abstract class CRM_Import_DataSource { * @param string $key * @param array $data * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function updateUserJobMetadata(string $key, array $data): void { @@ -490,7 +485,6 @@ abstract class CRM_Import_DataSource { * then it might decided not to drop the table and would want to retain * some metadata. * - * @throws \API_Exception * @throws \CRM_Core_Exception * * @noinspection PhpUnusedParameterInspection @@ -520,7 +514,7 @@ abstract class CRM_Import_DataSource { * administrative fields, relying on this convention. * 3) we have the capitalisation on _statusMsg - @param string $tableName * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @todo change to _status_message */ protected function addTrackingFieldsToTable(string $tableName): void { @@ -540,7 +534,7 @@ abstract class CRM_Import_DataSource { /** * Get any additional import specific tracking fields. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function getAdditionalTrackingFields(): string { $sql = ''; @@ -556,7 +550,7 @@ abstract class CRM_Import_DataSource { * * @return CRM_Import_Parser * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ private function getParser() { $parserClass = ''; @@ -578,7 +572,6 @@ abstract class CRM_Import_DataSource { * @return bool * True if no rows remain to be imported. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function isCompleted(): bool { @@ -596,7 +589,6 @@ abstract class CRM_Import_DataSource { * @param array $additionalFields * Optional array e.g ['related_contact' => 4] * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function updateStatus(int $id, string $status, string $message, ? int $entityID = NULL, array $additionalFields = []): void { @@ -617,7 +609,6 @@ abstract class CRM_Import_DataSource { /** * - * @throws \API_Exception * @throws \CRM_Core_Exception */ private function instantiateQueryObject(): void { diff --git a/CRM/Import/DataSource/CSV.php b/CRM/Import/DataSource/CSV.php index 2c8a19b3c4..17a57912dd 100644 --- a/CRM/Import/DataSource/CSV.php +++ b/CRM/Import/DataSource/CSV.php @@ -70,7 +70,6 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { /** * Initialize the datasource, based on the submitted values stored in the user job. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function initialize(): void { diff --git a/CRM/Import/DataSource/SQL.php b/CRM/Import/DataSource/SQL.php index d552d45103..ad6ac14ea0 100644 --- a/CRM/Import/DataSource/SQL.php +++ b/CRM/Import/DataSource/SQL.php @@ -76,7 +76,6 @@ class CRM_Import_DataSource_SQL extends CRM_Import_DataSource { /** * Initialize the datasource, based on the submitted values stored in the user job. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function initialize(): void { diff --git a/CRM/Import/Form/DataSource.php b/CRM/Import/Form/DataSource.php index 7376d96340..7e04646bdc 100644 --- a/CRM/Import/Form/DataSource.php +++ b/CRM/Import/Form/DataSource.php @@ -173,7 +173,6 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms { /** * Process the datasource submission - setting up the job and data source. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function processDatasource(): void { @@ -192,7 +191,6 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms { * * This gives the datasource a chance to do any table creation etc. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ private function instantiateDataSource(): void { diff --git a/CRM/Import/Form/DataSourceConfig.php b/CRM/Import/Form/DataSourceConfig.php index e5ddfc870b..697de6c997 100644 --- a/CRM/Import/Form/DataSourceConfig.php +++ b/CRM/Import/Form/DataSourceConfig.php @@ -48,7 +48,6 @@ class CRM_Import_Form_DataSourceConfig extends CRM_Import_Forms { * * @return array * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function setDefaultValues() { @@ -70,7 +69,7 @@ class CRM_Import_Form_DataSourceConfig extends CRM_Import_Forms { * @param string $fieldName * * @return mixed|null - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getSubmittedValue(string $fieldName) { $userJob = $this->getUserJob(); diff --git a/CRM/Import/Form/MapField.php b/CRM/Import/Form/MapField.php index ababc7c455..b8172ede95 100644 --- a/CRM/Import/Form/MapField.php +++ b/CRM/Import/Form/MapField.php @@ -188,7 +188,7 @@ abstract class CRM_Import_Form_MapField extends CRM_Import_Forms { * @param int|null $savedMappingID * * @deprecated - working to remove this in favour of `addSavedMappingFields` - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function buildSavedMappingFields($savedMappingID) { //to save the current mappings @@ -267,7 +267,6 @@ abstract class CRM_Import_Form_MapField extends CRM_Import_Forms { * @param int $columnNumber * @param bool $isUpdate * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function saveMappingField(int $mappingID, int $columnNumber, bool $isUpdate = FALSE): void { @@ -294,7 +293,6 @@ abstract class CRM_Import_Form_MapField extends CRM_Import_Forms { /** * Save the Field Mapping. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function saveMapping(): void { @@ -322,7 +320,6 @@ abstract class CRM_Import_Form_MapField extends CRM_Import_Forms { } /** - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ diff --git a/CRM/Import/Form/Preview.php b/CRM/Import/Form/Preview.php index 2232994440..d0994b0fe9 100644 --- a/CRM/Import/Form/Preview.php +++ b/CRM/Import/Form/Preview.php @@ -62,7 +62,6 @@ abstract class CRM_Import_Form_Preview extends CRM_Import_Forms { /** * Assign smarty variables for the preview screen. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function assignPreviewVariables(): void { diff --git a/CRM/Import/Forms.php b/CRM/Import/Forms.php index aeddf0e3bd..e15a0daa9e 100644 --- a/CRM/Import/Forms.php +++ b/CRM/Import/Forms.php @@ -75,7 +75,7 @@ class CRM_Import_Forms extends CRM_Core_Form { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getUserJob(): array { if (!$this->userJob) { @@ -91,7 +91,7 @@ class CRM_Import_Forms extends CRM_Core_Form { * Get submitted values stored in the user job. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getUserJobSubmittedValues(): array { return $this->getUserJob()['metadata']['submitted_values']; @@ -264,7 +264,6 @@ class CRM_Import_Forms extends CRM_Core_Form { * - however, the sql class, for example, might realise the fields it cares * about are unchanged and not flush the table. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function flushDataSource(): void { @@ -366,7 +365,7 @@ class CRM_Import_Forms extends CRM_Core_Form { * * @return int * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function createUserJob(): int { $id = UserJob::create(FALSE) @@ -390,7 +389,7 @@ class CRM_Import_Forms extends CRM_Core_Form { * @param string $key * @param array $data * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function updateUserJobMetadata(string $key, array $data): void { @@ -414,7 +413,6 @@ class CRM_Import_Forms extends CRM_Core_Form { * * @return array * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function getColumnHeaders(): array { @@ -426,7 +424,6 @@ class CRM_Import_Forms extends CRM_Core_Form { * * @return int * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function getNumberOfColumns(): int { @@ -448,7 +445,6 @@ class CRM_Import_Forms extends CRM_Core_Form { * or [CRM_Import_Parser::ERROR, CRM_Import_Parser::VALID] * * @throws \CRM_Core_Exception - * @throws \API_Exception */ protected function getDataRows($statuses = [], int $limit = 0): array { $statuses = (array) $statuses; @@ -462,7 +458,6 @@ class CRM_Import_Forms extends CRM_Core_Form { * @param int $limit * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function getOutputRows($statuses = [], int $limit = 0) { @@ -491,7 +486,6 @@ class CRM_Import_Forms extends CRM_Core_Form { * * @return int * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function getRowCount($statuses = []) { @@ -505,7 +499,7 @@ class CRM_Import_Forms extends CRM_Core_Form { * This gets the rows from the temp table that match the relevant status * and output them as a csv. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \League\Csv\CannotInsertRecord * @throws \CRM_Core_Exception */ @@ -575,7 +569,7 @@ class CRM_Import_Forms extends CRM_Core_Form { * @return array * e.g ['first_name' => 'First Name', 'last_name' => 'Last Name'.... * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getAvailableFields(): array { $return = []; @@ -655,7 +649,7 @@ class CRM_Import_Forms extends CRM_Core_Form { * ['First Name', 'Employee Of - First Name', 'Home - Street Address'] * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getMappedFieldLabels(): array { $mapper = []; @@ -669,7 +663,6 @@ class CRM_Import_Forms extends CRM_Core_Form { /** * Assign variables required for the MapField form. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function assignMapFieldVariables(): void { diff --git a/CRM/Import/ImportProcessor.php b/CRM/Import/ImportProcessor.php index a9c7cb876f..e125e82aad 100644 --- a/CRM/Import/ImportProcessor.php +++ b/CRM/Import/ImportProcessor.php @@ -162,7 +162,7 @@ class CRM_Import_ImportProcessor { * * @param array $metadata * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setMetadata(array $metadata) { $fieldDetails = civicrm_api3('CustomField', 'get', [ @@ -231,7 +231,7 @@ class CRM_Import_ImportProcessor { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getMappingFields(): array { if (empty($this->mappingFields) && !empty($this->getMappingID())) { @@ -268,7 +268,7 @@ class CRM_Import_ImportProcessor { /** * Get the names of the mapped fields. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getFieldNames() { return CRM_Utils_Array::collect('name', $this->getMappingFields()); @@ -280,7 +280,7 @@ class CRM_Import_ImportProcessor { * @param int $columnNumber * * @return string - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getFieldName($columnNumber) { return $this->getFieldNames()[$columnNumber]; @@ -292,7 +292,7 @@ class CRM_Import_ImportProcessor { * @param int $columnNumber * * @return string - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getRelationshipKey($columnNumber) { $field = $this->getMappingFields()[$columnNumber]; @@ -306,7 +306,7 @@ class CRM_Import_ImportProcessor { * * @return string|null * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getValidRelationshipKey($columnNumber) { $key = $this->getRelationshipKey($columnNumber); @@ -320,7 +320,7 @@ class CRM_Import_ImportProcessor { * * @return int * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getIMProviderID($columnNumber) { return $this->getMappingFields()[$columnNumber]['im_provider_id'] ?? NULL; @@ -333,7 +333,7 @@ class CRM_Import_ImportProcessor { * * @return int * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getPhoneTypeID($columnNumber) { return $this->getMappingFields()[$columnNumber]['phone_type_id'] ?? NULL; @@ -346,7 +346,7 @@ class CRM_Import_ImportProcessor { * * @return int * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getWebsiteTypeID($columnNumber) { return $this->getMappingFields()[$columnNumber]['website_type_id'] ?? NULL; @@ -361,7 +361,7 @@ class CRM_Import_ImportProcessor { * * @return int * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getLocationTypeID($columnNumber) { return $this->getMappingFields()[$columnNumber]['location_type_id'] ?? 0; @@ -376,7 +376,7 @@ class CRM_Import_ImportProcessor { * * @return int * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getPhoneOrIMTypeID($columnNumber) { return $this->getIMProviderID($columnNumber) ?? $this->getPhoneTypeID($columnNumber); @@ -385,7 +385,7 @@ class CRM_Import_ImportProcessor { /** * Get the location types of the mapped fields. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getFieldLocationTypes() { return CRM_Utils_Array::collect('location_type_id', $this->getMappingFields()); @@ -394,7 +394,7 @@ class CRM_Import_ImportProcessor { /** * Get the phone types of the mapped fields. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getFieldPhoneTypes() { return CRM_Utils_Array::collect('phone_type_id', $this->getMappingFields()); @@ -403,7 +403,7 @@ class CRM_Import_ImportProcessor { /** * Get the names of the im_provider fields. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getFieldIMProviderTypes() { return CRM_Utils_Array::collect('im_provider_id', $this->getMappingFields()); @@ -412,7 +412,7 @@ class CRM_Import_ImportProcessor { /** * Get the names of the website fields. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getFieldWebsiteTypes() { return CRM_Utils_Array::collect('im_provider_id', $this->getMappingFields()); @@ -423,7 +423,7 @@ class CRM_Import_ImportProcessor { * * @return CRM_Contact_Import_Parser_Contact * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getImporterObject() { $importer = new CRM_Contact_Import_Parser_Contact($this->getFieldNames()); @@ -435,7 +435,7 @@ class CRM_Import_ImportProcessor { /** * Load the mapping from the datbase into the format that would be received from the UI. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function loadSavedMapping() { $fields = civicrm_api3('MappingField', 'get', [ @@ -492,7 +492,7 @@ class CRM_Import_ImportProcessor { * This is preserved as a copy the upgrade script can use - since the * upgrade allows the other to be 'fixed'. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function legacyLoadSavedMapping() { $fields = civicrm_api3('MappingField', 'get', [ @@ -578,7 +578,7 @@ class CRM_Import_ImportProcessor { * @param int $column * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getSavedQuickformDefaultsForColumn($column) { $fieldMapping = []; @@ -613,7 +613,7 @@ class CRM_Import_ImportProcessor { /** * This exists for use in the FiveFifty Upgrade * - * @throws \API_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function convertSavedFields(): void { $mappings = Mapping::get(FALSE) diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index c76c845211..80f0110dc8 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -147,7 +147,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getUserJob(): array { if (empty($this->userJob)) { @@ -191,7 +191,6 @@ abstract class CRM_Import_Parser implements UserJobInterface { * * @return bool * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function isComplete() :bool { @@ -334,7 +333,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * @return array * eg. ['first_name' => 'First Name'.....] * - * @throws \API_Exception + * @throws \CRM_Core_Exception * * @todo - we are constructing the metadata before we * have set the contact type so we re-do it here. @@ -363,7 +362,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * * @return bool * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function isSkipDuplicates(): bool { return ((int) $this->getSubmittedValue('onDuplicate')) === CRM_Import_Parser::DUPLICATE_SKIP; @@ -1421,7 +1420,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * @param string $entity * * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getActionForEntity(string $entity): string { return $this->getUserJob()['metadata']['entity_configuration'][$entity]['action'] ?? ($this->getImportEntities()[$entity]['default_action'] ?? 'select'); @@ -1540,7 +1539,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * Value as it came in from the datasource. * * @return string|array|bool|int - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getTransformedFieldValue(string $fieldName, $importedValue) { if (empty($importedValue)) { @@ -1620,7 +1619,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * * @return false|array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getFieldOptions(string $fieldName) { return $this->getFieldMetadata($fieldName, TRUE)['options']; @@ -1764,7 +1763,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * @param string $fieldName * * @return mixed|null - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getFieldEntity(string $fieldName) { if ($fieldName === 'do_not_import' || $fieldName === '') { @@ -1788,7 +1787,6 @@ abstract class CRM_Import_Parser implements UserJobInterface { /** * Validate the import file, updating the import table with results. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function validate(): void { @@ -1813,7 +1811,6 @@ abstract class CRM_Import_Parser implements UserJobInterface { * * @param array $values * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function validateValues(array $values): void { @@ -1998,7 +1995,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * or as returned from getMappingFieldFromMapperInput * * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getMappedFieldLabel(array $mappedField): string { // doNotImport is on it's way out - skip fields will be '' once all is done. @@ -2016,7 +2013,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * @param array $values * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getMappedRow(array $values): array { $params = []; @@ -2039,7 +2036,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * Also 'im_provider_id' is mapped to the 'real' field name 'provider_id' * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getFieldMappings(): array { $mappedFields = []; @@ -2065,7 +2062,6 @@ abstract class CRM_Import_Parser implements UserJobInterface { * @param int $offset * * @return bool - * @throws \API_Exception * @throws \CRM_Core_Exception */ public static function runJob(\CRM_Queue_TaskContext $taskContext, int $userJobID, int $limit, int $offset): bool { @@ -2169,7 +2165,6 @@ abstract class CRM_Import_Parser implements UserJobInterface { * @return int|null * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function lookupExternalIdentifier(?string $externalIdentifier, ?string $contactType, ?int $contactID): ?int { if (!$externalIdentifier) { @@ -2440,7 +2435,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { * @param $name * * @return mixed - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function loadRules(array $where = []) { diff --git a/CRM/Invoicing/Utils.php b/CRM/Invoicing/Utils.php index 4a6e48ee54..70de2c7d4d 100644 --- a/CRM/Invoicing/Utils.php +++ b/CRM/Invoicing/Utils.php @@ -25,7 +25,7 @@ class CRM_Invoicing_Utils { * @param bool $newValue * @param array $metadata * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function onToggle($oldValue, $newValue, $metadata) { if ($oldValue == $newValue) { diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index bca2d05462..8dd8e8d8ea 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -481,7 +481,7 @@ ORDER BY log_date * @param string $change_date * * @return bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function checkLogCanBeUsedWithNoLogDate($change_date) { diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index a8ef7185ad..0ebab229c6 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -75,15 +75,15 @@ class CRM_Logging_Schema { * @param array $fieldSpec * * @return bool - * @throws API_Exception + * @throws CRM_Core_Exception */ public static function checkLoggingSupport(&$value, $fieldSpec) { if (!(CRM_Core_DAO::checkTriggerViewPermission(FALSE)) && $value) { - throw new API_Exception(ts("In order to use this functionality, the installation's database user must have privileges to create triggers and views (if binary logging is enabled – this means the SUPER privilege). This install does not have the required privilege(s) enabled.")); + throw new CRM_Core_Exception(ts("In order to use this functionality, the installation's database user must have privileges to create triggers and views (if binary logging is enabled – this means the SUPER privilege). This install does not have the required privilege(s) enabled.")); } // dev/core#1812 Disable logging in a multilingual environment. if (CRM_Core_I18n::isMultilingual() && $value) { - throw new API_Exception(ts("Logging is not supported in a multilingual environment!")); + throw new CRM_Core_Exception(ts("Logging is not supported in a multilingual environment!")); } return TRUE; } @@ -318,7 +318,7 @@ AND (TABLE_NAME LIKE 'log_civicrm_%' $nonStandardTableNameString ) * 'forceEngineMigration' - force engine upgrade from ARCHIVE to InnoDB? * * @return int $updateTablesCount - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function updateLogTableSchema($params) { $updateLogConn = FALSE; diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 1d2ceafc81..3d064f7e46 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1498,7 +1498,6 @@ ORDER BY civicrm_email.is_bulkmail DESC * $mailing The new mailing object * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function create(array $params) { @@ -1694,7 +1693,7 @@ ORDER BY civicrm_email.is_bulkmail DESC * @param string $entity * 'groups' or 'mailings'. * @param array $entityIds - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ public static function replaceGroups($mailingId, $type, $entity, $entityIds) { $values = []; diff --git a/CRM/Mailing/BAO/Query.php b/CRM/Mailing/BAO/Query.php index ced2040d76..e5440a8295 100644 --- a/CRM/Mailing/BAO/Query.php +++ b/CRM/Mailing/BAO/Query.php @@ -116,7 +116,7 @@ class CRM_Mailing_BAO_Query { /** * Get the metadata for fields to be included on the mailing search form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * * @todo ideally this would be a trait included on the mailing search & advanced search * rather than a static function. @@ -391,7 +391,7 @@ class CRM_Mailing_BAO_Query { * * @param \CRM_Mailing_Form_Search $form * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function buildSearchForm(&$form) { $form->addSearchFieldMetadata(['Mailing' => self::getSearchFieldMetadata()]); diff --git a/CRM/Mailing/Event/BAO/Unsubscribe.php b/CRM/Mailing/Event/BAO/Unsubscribe.php index f2c92079e9..f0fffc4814 100644 --- a/CRM/Mailing/Event/BAO/Unsubscribe.php +++ b/CRM/Mailing/Event/BAO/Unsubscribe.php @@ -106,7 +106,6 @@ WHERE email = %2 * $groups Array of all groups from which the contact was removed, or null if the queue event could not be found. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function unsub_from_mailing($job_id, $queue_id, $hash, $return = FALSE): ?array { // First make sure there's a matching queue event. diff --git a/CRM/Mailing/Form/Search.php b/CRM/Mailing/Form/Search.php index 04f321d995..cf717ff398 100644 --- a/CRM/Mailing/Form/Search.php +++ b/CRM/Mailing/Form/Search.php @@ -30,7 +30,7 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form_Search { } /** - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function buildQuickForm() { $parent = $this->controller->getParent(); @@ -157,7 +157,7 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form_Search { * Search field metadata is normally added in buildForm but we are bypassing that in this flow * (I've always found the flow kinda confusing & perhaps that is the problem but this mitigates) * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function handleForcedSearch() { $this->setSearchMetadata(); @@ -167,7 +167,7 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form_Search { /** * Set the metadata for the form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setSearchMetadata() { $this->addSearchFieldMetadata(['Mailing' => CRM_Mailing_BAO_Query::getSearchFieldMetadata()]); diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 40e6d0a5f0..7d85c1868c 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -41,7 +41,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * (reference ) an assoc array of name/value pairs. * * @return CRM_Member_BAO_Membership - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function add(&$params) { $oldStatus = $oldType = NULL; @@ -232,7 +232,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * Deprecated parameter The array that holds all the db ids. * * @return CRM_Member_BAO_Membership|CRM_Core_Error - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * * @throws CRM_Core_Exception */ @@ -469,7 +469,6 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * array of contact_id of all related contacts. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function checkMembershipRelationship($membershipTypeID, $contactId, $action = CRM_Core_Action::ADD) { $contacts = []; @@ -789,7 +788,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * True if only Memberships with same parent org as the $memType wanted, false otherwise. * * @return array|bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getContactMembership($contactID, $memType, $isTest, $membershipId = NULL, $onlySameParentOrg = FALSE) { //check for owner membership id, if it exists update that membership instead: CRM-15992 @@ -1338,7 +1337,6 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * Membership object. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function createRelatedMemberships($params, $dao) { unset($params['membership_id']); @@ -1556,7 +1554,7 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function buildMembershipTypeValues($form, $membershipTypeID = [], $activeOnly = FALSE) { $membershipTypeIDS = (array) $membershipTypeID; @@ -1582,7 +1580,7 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * @param bool $activeOnly * * @return int - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function getContactMembershipCount(int $contactID, $activeOnly = FALSE): int { try { @@ -1794,7 +1792,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * * @return array * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function processMembership($contactID, $membershipTypeID, $is_test, $changeToday, $modifiedID, $customFieldsFormatted, $numRenewTerms, $membershipID, $pending, $contributionRecurID, $membershipSource, $isPayLater, $memParams = [], $contribution = NULL, $lineItems = []) { CRM_Core_Error::deprecatedFunctionWarning('use the order api, BAO functions should only be called from unit tested core code.'); @@ -2049,7 +2046,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @return int * Count of updated contacts. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ protected static function updateDeceasedMembersStatuses() { @@ -2133,7 +2129,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @param array $params * * @return bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected static function hasExistingInheritedMembership($params) { foreach (civicrm_api3('Membership', 'get', ['contact_id' => $params['contact_id']])['values'] as $membership) { @@ -2157,7 +2153,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @param int $membershipId * @param array $lineItem * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function processPriceSet($membershipId, $lineItem) { //FIXME : need to move this too @@ -2222,7 +2218,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * * @return array * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public static function updateAllMembershipStatus($params = []) { @@ -2338,7 +2333,7 @@ WHERE {$whereClause}"; * @param CRM_Core_DAO $membership * The membership to be processed * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private static function processOverriddenUntilDateMembership($membership) { $isOverriddenUntilDate = !empty($membership->is_override) && !empty($membership->status_override_end_date); @@ -2407,7 +2402,6 @@ WHERE {$whereClause}"; * * @return CRM_Contribute_BAO_Contribution * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function recordMembershipContribution(&$params) { $contributionParams = []; diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 7263f8f3c2..6d935c9453 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -65,7 +65,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType implem * Array contains the id (deprecated). * * @return \CRM_Member_DAO_MembershipType - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function add(&$params, $ids = []) { // DEPRECATED Check if membershipType ID was passed in via $ids @@ -116,7 +116,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType implem /** * Flush anywhere that membership types might be cached. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function flush() { CRM_Member_PseudoConstant::membershipType(NULL, TRUE); @@ -822,7 +822,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType implem * * @return array * List of membershipType details keyed by membershipTypeID - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getAllMembershipTypes(): array { $cacheString = __CLASS__ . __FUNCTION__ . CRM_Core_Config::domainID() . '_' . CRM_Core_I18n::getLocale(); @@ -863,7 +863,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType implem * @param int $id * * @return mixed - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getMembershipType($id) { return self::getAllMembershipTypes()[$id]; diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index 7f91f01a40..3f94e2e386 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -489,7 +489,7 @@ class CRM_Member_BAO_Query extends CRM_Core_BAO_Query { /** * Get the metadata for fields to be included on the grant search form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getSearchFieldMetadata() { $fields = [ @@ -515,7 +515,7 @@ class CRM_Member_BAO_Query extends CRM_Core_BAO_Query { * * @param CRM_Core_Form $form * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function buildSearchForm(&$form) { $form->addSearchFieldMetadata(['Membership' => self::getSearchFieldMetadata()]); diff --git a/CRM/Member/Form.php b/CRM/Member/Form.php index c1003f6226..e52bccbea9 100644 --- a/CRM/Member/Form.php +++ b/CRM/Member/Form.php @@ -399,7 +399,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { * @param int $membershipTypeID * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function processRecurringContribution($contributionRecurParams, $membershipTypeID) { @@ -489,7 +489,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { * @param array $formValues * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function setPriceSetParameters(array $formValues): array { // process price set and get total amount and line items. @@ -532,7 +532,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getOrderParams(): array { return [ diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 60e1d45912..4e193c7928 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -215,7 +215,6 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { * Form preProcess function. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { // This string makes up part of the class names, differentiating them (not sure why) from the membership fields. @@ -659,7 +658,7 @@ DESC limit 1"); * mixed true or array of errors * * @throws \CRM_Core_Exception - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ public static function formRule($params, $files, $self) { $errors = []; @@ -864,7 +863,6 @@ DESC limit 1"); * Process the form submission. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function postProcess() { if ($this->_action & CRM_Core_Action::DELETE) { @@ -917,7 +915,6 @@ DESC limit 1"); * @return bool * true if mail was sent successfully * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * * @deprecated * This function was shared with Batch_Entry which had limited overlap @@ -1004,8 +1001,6 @@ DESC limit 1"); * This is also accessed by unit tests. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public function submit(): void { $this->storeContactFields($this->_params); @@ -1390,7 +1385,6 @@ DESC limit 1"); * submitted form values * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function updateContributionOnMembershipTypeChange($inputParams) { if (Civi::settings()->get('update_contribution_on_membership_type_change') && @@ -1496,7 +1490,7 @@ DESC limit 1"); * Get status message for updating membership. * * @return string - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getStatusMessageForUpdate(): string { foreach ($this->getCreatedMemberships() as $membership) { @@ -1514,7 +1508,7 @@ DESC limit 1"); * Get status message for create action. * * @return string - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getStatusMessageForCreate(): string { foreach ($this->getCreatedMemberships() as $membership) { @@ -1582,7 +1576,6 @@ DESC limit 1"); * * @return bool * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function emailMembershipReceipt($formValues) { $customValues = $this->getCustomValuesForReceipt($formValues); @@ -1665,8 +1658,7 @@ DESC limit 1"); * * @return int|null * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getContributionRecurID():?int { if (!array_key_exists('ContributionRecur', $this->ids)) { @@ -1680,8 +1672,7 @@ DESC limit 1"); * * This function was copied from another form & needs cleanup. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function createRecurringContribution(): void { if (!$this->isCreateRecurringContribution()) { @@ -1736,7 +1727,7 @@ DESC limit 1"); * Get the membership type, if any, to be recurred. * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getRecurMembershipType(): array { foreach ($this->order->getRenewableMembershipTypes() as $type) { @@ -1749,7 +1740,7 @@ DESC limit 1"); * Get the frequency interval. * * @return int|null - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getFrequencyInterval(): ?int { $membershipType = $this->getRecurMembershipType(); @@ -1760,7 +1751,7 @@ DESC limit 1"); * Get the frequency interval. * * @return string|null - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getFrequencyUnit(): ?string { $membershipType = $this->getRecurMembershipType(); @@ -1779,8 +1770,7 @@ DESC limit 1"); * against breakage if code is moved around). * * @return array - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getFormMembershipParams(): array { $submittedValues = $this->controller->exportValues($this->_name); @@ -1825,7 +1815,7 @@ DESC limit 1"); * Get memberships submitted through the form submission. * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getCreatedMemberships(): array { return civicrm_api3('Membership', 'get', ['id' => ['IN' => $this->_membershipIDs]])['values']; @@ -1835,7 +1825,7 @@ DESC limit 1"); * Get parameters for membership create for all memberships to be created. * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getMembershipParameters(): array { $membershipTypeValues = []; @@ -1917,7 +1907,7 @@ DESC limit 1"); * Get the membership (or last membership) created or edited on this form. * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getMembership(): array { if (empty($this->membership)) { @@ -1943,7 +1933,7 @@ DESC limit 1"); * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getLineItemForOrderApi(): array { $lineItems = []; @@ -1966,7 +1956,7 @@ DESC limit 1"); * @param int $membershipTypeID * * @return mixed - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function getMembershipParamsForType(int $membershipTypeID) { return array_merge($this->getFormMembershipParams(), $this->getMembershipParameters()[$membershipTypeID]); diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php index 2148be9f6e..a7a3abfac8 100644 --- a/CRM/Member/Form/MembershipBlock.php +++ b/CRM/Member/Form/MembershipBlock.php @@ -93,7 +93,6 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa * Build the form object. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm() { $membershipTypes = CRM_Member_BAO_MembershipType::getMembershipTypes(); @@ -211,7 +210,6 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa * @return bool|array * mixed true or array of errors * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function formRule($params, $files, $contributionPageId = NULL) { $errors = []; diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index dede5c99d5..433e563ab6 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -122,7 +122,6 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { * Preprocess form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { @@ -456,7 +455,6 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { * Process the renewal form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function postProcess(): void { // get the submitted form values. @@ -481,7 +479,6 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { * This function is also accessed by a unit test. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function submit() { $this->storeContactFields($this->_params); @@ -728,7 +725,6 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { * * @return CRM_Member_BAO_Membership * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function processMembership($memParams, $changeToday, $numRenewTerms, $pending) { $allStatus = CRM_Member_PseudoConstant::membershipStatus(); diff --git a/CRM/Member/Form/MembershipType.php b/CRM/Member/Form/MembershipType.php index e715fe35c0..da1ee84059 100644 --- a/CRM/Member/Form/MembershipType.php +++ b/CRM/Member/Form/MembershipType.php @@ -222,7 +222,6 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig { * * @return void * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm() { self::buildQuickEntityForm(); diff --git a/CRM/Member/Form/MembershipView.php b/CRM/Member/Form/MembershipView.php index a8af679e49..5f6b4fc0e3 100644 --- a/CRM/Member/Form/MembershipView.php +++ b/CRM/Member/Form/MembershipView.php @@ -92,7 +92,6 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form { * Primary membership info (membership_id, contact_id, membership_type ...). * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function relAction($action, $owner) { switch ($action) { diff --git a/CRM/Member/Form/Search.php b/CRM/Member/Form/Search.php index a0cc3e5ea0..d3816b9a3f 100644 --- a/CRM/Member/Form/Search.php +++ b/CRM/Member/Form/Search.php @@ -60,7 +60,6 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { * Processing needed for buildForm and later. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function preProcess() { // SearchFormName is deprecated & to be removed - the replacement is for the task to @@ -109,7 +108,6 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { * Build the form object. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function buildQuickForm() { parent::buildQuickForm(); @@ -349,7 +347,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { /** * Set the metadata for the form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setSearchMetadata() { $this->addSearchFieldMetadata(['Membership' => CRM_Member_BAO_Query::getSearchFieldMetadata()]); diff --git a/CRM/Member/Form/Task.php b/CRM/Member/Form/Task.php index 756355c1e9..8374e85fdf 100644 --- a/CRM/Member/Form/Task.php +++ b/CRM/Member/Form/Task.php @@ -107,7 +107,7 @@ class CRM_Member_Form_Task extends CRM_Core_Form_Task { /** * Get the rows form the search, keyed to make the token processor happy. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getRows(): array { if (empty($this->rows)) { diff --git a/CRM/Member/Form/Task/Batch.php b/CRM/Member/Form/Task/Batch.php index a333d3a4e1..abd3ecd489 100644 --- a/CRM/Member/Form/Task/Batch.php +++ b/CRM/Member/Form/Task/Batch.php @@ -188,7 +188,6 @@ class CRM_Member_Form_Task_Batch extends CRM_Member_Form_Task { * Process the form after the input has been submitted and validated. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function postProcess() { $params = $this->exportValues(); @@ -206,7 +205,6 @@ class CRM_Member_Form_Task_Batch extends CRM_Member_Form_Task { * * @return mixed * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function submit(array $params) { $dates = [ diff --git a/CRM/Member/Form/Task/PDFLetter.php b/CRM/Member/Form/Task/PDFLetter.php index f7464b1b70..fdc9ad6cad 100644 --- a/CRM/Member/Form/Task/PDFLetter.php +++ b/CRM/Member/Form/Task/PDFLetter.php @@ -115,7 +115,6 @@ class CRM_Member_Form_Task_PDFLetter extends CRM_Member_Form_Task { * @param $html_message * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception * @internal * diff --git a/CRM/Member/Form/Task/PDFLetterCommon.php b/CRM/Member/Form/Task/PDFLetterCommon.php index 7fdc8dce85..f5aae8890b 100644 --- a/CRM/Member/Form/Task/PDFLetterCommon.php +++ b/CRM/Member/Form/Task/PDFLetterCommon.php @@ -67,7 +67,6 @@ class CRM_Member_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDFLett * @param $categories * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException * @deprecated diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index a2d5554cb6..3a29c4bc57 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -343,7 +343,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Import_Parser { $this->setImportStatus($rowNumber, 'ERROR', $e->getMessage()); return CRM_Import_Parser::ERROR; } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { $this->setImportStatus($rowNumber, 'ERROR', $e->getMessage()); return CRM_Import_Parser::ERROR; } diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index 5878ff8d1d..14d5337ca3 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -354,7 +354,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { * action has to be taken for the page. * * @return null - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function run() { $this->preProcess(); diff --git a/CRM/Member/Tokens.php b/CRM/Member/Tokens.php index 35ba54a355..0b6916f383 100644 --- a/CRM/Member/Tokens.php +++ b/CRM/Member/Tokens.php @@ -57,7 +57,7 @@ class CRM_Member_Tokens extends CRM_Core_EntityTokens { /** * @inheritDoc - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function evaluateToken(\Civi\Token\TokenRow $row, $entity, $field, $prefetch = NULL) { if ($field === 'fee') { diff --git a/CRM/Member/Utils/RelationshipProcessor.php b/CRM/Member/Utils/RelationshipProcessor.php index 7021860f31..63f66ba2fc 100644 --- a/CRM/Member/Utils/RelationshipProcessor.php +++ b/CRM/Member/Utils/RelationshipProcessor.php @@ -41,7 +41,7 @@ class CRM_Member_Utils_RelationshipProcessor { * @param int[] $contactIDs * @param bool $active * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function __construct($contactIDs, $active) { $this->contactIDs = $contactIDs; @@ -72,7 +72,7 @@ class CRM_Member_Utils_RelationshipProcessor { * We are looking at relationships that are potentially inheritable * so we can filter out membership types with NULL relationship_type_id * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setMemberships() { $return = array_keys(civicrm_api3('Membership', 'getfields', [])['values']); diff --git a/CRM/PCP/BAO/PCP.php b/CRM/PCP/BAO/PCP.php index dcd24511a9..bcabd19e66 100644 --- a/CRM/PCP/BAO/PCP.php +++ b/CRM/PCP/BAO/PCP.php @@ -455,7 +455,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id = %2 AND cc.is_test = 0"; * @param CRM_Core_Form $page * @param array $elements * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function buildPcp($pcpId, &$page, &$elements = NULL) { $prms = ['id' => $pcpId]; diff --git a/CRM/Pledge/BAO/Pledge.php b/CRM/Pledge/BAO/Pledge.php index 8186bd45b4..20cc015430 100644 --- a/CRM/Pledge/BAO/Pledge.php +++ b/CRM/Pledge/BAO/Pledge.php @@ -981,7 +981,7 @@ SELECT pledge.contact_id as contact_id, try { civicrm_api3('activity', 'create', $activityParams); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { throw new CRM_Core_Exception('Failed creating Activity for Pledge Reminder: ' . $e->getMessage()); } $returnMessages[] = "Payment reminder sent to: {$pledgerName} - {$toEmail}"; diff --git a/CRM/Pledge/BAO/PledgePayment.php b/CRM/Pledge/BAO/PledgePayment.php index 73fd3a3546..4c9e98bbf7 100644 --- a/CRM/Pledge/BAO/PledgePayment.php +++ b/CRM/Pledge/BAO/PledgePayment.php @@ -558,7 +558,7 @@ WHERE civicrm_pledge.id = %2 * * @return int * $statusId calculated status id of pledge - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function calculatePledgeStatus(int $pledgeId): int { if (count(Pledge::get(FALSE) @@ -853,7 +853,7 @@ WHERE civicrm_pledge_payment.contribution_id = {$paymentContributionId} * * @param \Civi\Core\Event\GenericHookEvent $event * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function on_hook_civicrm_post(GenericHookEvent $event): void { if (!CRM_Core_Component::isEnabled('CiviPledge')) { diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 45f9b1c37c..6e2881b1c8 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -497,7 +497,7 @@ class CRM_Pledge_BAO_Query extends CRM_Core_BAO_Query { /** * Get the metadata for fields to be included on the grant search form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getSearchFieldMetadata() { $fields = [ @@ -513,7 +513,7 @@ class CRM_Pledge_BAO_Query extends CRM_Core_BAO_Query { /** * Get the metadata for fields to be included on the grant search form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getPledgePaymentSearchFieldMetadata() { $fields = [ @@ -529,7 +529,6 @@ class CRM_Pledge_BAO_Query extends CRM_Core_BAO_Query { * @param CRM_Pledge_Form_Search|\CRM_Contact_Form_Search_Advanced $form * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function buildSearchForm(&$form) { // pledge related dates diff --git a/CRM/Pledge/Form/Pledge.php b/CRM/Pledge/Form/Pledge.php index 16aa81a3b6..6ccbfce6f1 100644 --- a/CRM/Pledge/Form/Pledge.php +++ b/CRM/Pledge/Form/Pledge.php @@ -417,7 +417,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { /** * Process the form submission. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function postProcess(): void { if ($this->_action & CRM_Core_Action::DELETE) { diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php index 7f7e75c529..88c7776ea3 100644 --- a/CRM/Pledge/Form/Search.php +++ b/CRM/Pledge/Form/Search.php @@ -352,7 +352,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { /** * Set the metadata for the form. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setSearchMetadata() { $this->addSearchFieldMetadata(['Pledge' => CRM_Pledge_BAO_Query::getSearchFieldMetadata()]); diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 8251e12760..6399dade3d 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -28,7 +28,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { * * @return CRM_Price_BAO_LineItem * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception */ public static function create(&$params) { @@ -372,7 +372,6 @@ WHERE li.contribution_id = %1"; * @param bool $update * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function processPriceSet($entityId, $lineItems, $contributionDetails = NULL, $entityTable = 'civicrm_contribution', $update = FALSE) { if (!$entityId || !is_array($lineItems) @@ -614,7 +613,7 @@ WHERE li.contribution_id = %1"; * @param $feeBlock * @param array $lineItems * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function changeFeeSelections( $params, @@ -1120,7 +1119,7 @@ WHERE li.contribution_id = %1"; ], ]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { return []; } diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index 9a3d87b762..fb69452505 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -47,7 +47,6 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { * @return CRM_Price_DAO_PriceField * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public static function create(&$params) { if (empty($params['id']) && empty($params['name'])) { diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index cdfea438f8..ec5896ad91 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -638,7 +638,6 @@ class CRM_Price_Form_Field extends CRM_Core_Form { * Process the form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function postProcess() { // store the submitted values in an array diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php index 02b623bb27..367848abf2 100644 --- a/CRM/Profile/Form/Edit.php +++ b/CRM/Profile/Form/Edit.php @@ -243,9 +243,7 @@ SELECT module,is_reserved /** * Process the user submitted custom data values. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function postProcess() { parent::postProcess(); diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index fe01add149..402e25eee5 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -442,7 +442,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { * @param string $email * * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function getLinkedEmail($email): string { diff --git a/CRM/Queue/BAO/Queue.php b/CRM/Queue/BAO/Queue.php index db62b41289..bbd3cadc46 100644 --- a/CRM/Queue/BAO/Queue.php +++ b/CRM/Queue/BAO/Queue.php @@ -97,7 +97,7 @@ class CRM_Queue_BAO_Queue extends CRM_Queue_DAO_Queue implements \Civi\Core\Hook * @param \CRM_Queue_Queue $queue * @param array $items * @param array $outcomes - * @throws \API_Exception + * @throws \CRM_Core_Exception * @see CRM_Utils_Hook::queueRun() */ public static function hook_civicrm_queueRun_task(CRM_Queue_Queue $queue, array $items, array &$outcomes) { diff --git a/CRM/Queue/TaskRunner.php b/CRM/Queue/TaskRunner.php index 002e93b2ae..8c42ab8425 100644 --- a/CRM/Queue/TaskRunner.php +++ b/CRM/Queue/TaskRunner.php @@ -29,7 +29,7 @@ class CRM_Queue_TaskRunner { * - 'retry': Task encountered an error. Will try again later. * - 'delete': Task encountered an error. Will not try again later. Removed from queue. * - 'abort': Task encountered an error. Will not try again later. Stopped the queue. - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function run(CRM_Queue_Queue $queue, $item): string { $this->assertType($item->data, ['CRM_Queue_Task'], 'Cannot run. Invalid task given.'); @@ -42,14 +42,14 @@ class CRM_Queue_TaskRunner { if (is_numeric($queue->getSpec('retry_limit')) && $item->run_count > 1 + $queue->getSpec('retry_limit')) { \Civi::log()->debug("Skipping exhausted task: " . $task->title); $outcome = $queue->getSpec('error'); - $exception = new \API_Exception(sprintf('Skipping exhausted task after %d tries: %s', $item->run_count, print_r($task, 1)), 'queue_retry_exhausted'); + $exception = new \CRM_Core_Exception(sprintf('Skipping exhausted task after %d tries: %s', $item->run_count, print_r($task, 1)), 'queue_retry_exhausted'); } else { \Civi::log()->debug("Running task: " . $task->title); try { $runResult = $task->run($this->createContext($queue)); $outcome = $runResult ? 'ok' : $queue->getSpec('error'); - $exception = ($outcome === 'ok') ? NULL : new \API_Exception('Queue task returned false', 'queue_false'); + $exception = ($outcome === 'ok') ? NULL : new \CRM_Core_Exception('Queue task returned false', 'queue_false'); } catch (\Exception $e) { $outcome = $queue->getSpec('error'); diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 1626a0383f..17814e7fec 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -3825,7 +3825,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * * This function is called by both the api (tests) and the UI. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function buildGroupTempTable(): void { if (!empty($this->groupTempTable) || empty($this->_params['gid_value']) || $this->groupFilterNotOptimised) { diff --git a/CRM/Report/Form/Contact/LoggingSummary.php b/CRM/Report/Form/Contact/LoggingSummary.php index ad6a1903fd..e56e654967 100644 --- a/CRM/Report/Form/Contact/LoggingSummary.php +++ b/CRM/Report/Form/Contact/LoggingSummary.php @@ -180,7 +180,6 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { * Rows generated by SQL, with an array for each row. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function alterDisplay(&$rows) { // cache for id → is_deleted mapping diff --git a/CRM/Upgrade/Incremental/Base.php b/CRM/Upgrade/Incremental/Base.php index e9bf28307d..a52d0aaa25 100644 --- a/CRM/Upgrade/Incremental/Base.php +++ b/CRM/Upgrade/Incremental/Base.php @@ -235,7 +235,7 @@ class CRM_Upgrade_Incremental_Base { * @param CRM_Queue_TaskContext $ctx * @param string $name * @return bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function removePaymentProcessorType(CRM_Queue_TaskContext $ctx, $name) { $processors = civicrm_api3('PaymentProcessor', 'getcount', ['payment_processor_type_id' => $name]); diff --git a/CRM/Upgrade/Incremental/MessageTemplates.php b/CRM/Upgrade/Incremental/MessageTemplates.php index dca70ec0ca..238515d04d 100644 --- a/CRM/Upgrade/Incremental/MessageTemplates.php +++ b/CRM/Upgrade/Incremental/MessageTemplates.php @@ -446,7 +446,7 @@ class CRM_Upgrade_Incremental_MessageTemplates { * @param string $old * @param string $new * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function replaceTokenInGreetingOptions(string $old, string $new): void { $oldToken = '{' . $old . '}'; diff --git a/CRM/Upgrade/Incremental/php/FiveFifty.php b/CRM/Upgrade/Incremental/php/FiveFifty.php index 7d600df0de..d59a42d626 100644 --- a/CRM/Upgrade/Incremental/php/FiveFifty.php +++ b/CRM/Upgrade/Incremental/php/FiveFifty.php @@ -60,8 +60,7 @@ class CRM_Upgrade_Incremental_php_FiveFifty extends CRM_Upgrade_Incremental_Base * (Getting the other entities done is a stretch goal). * * @return bool - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function convertMappingFieldLabelsToNames(): bool { CRM_Import_ImportProcessor::convertSavedFields(); diff --git a/CRM/Upgrade/Incremental/php/FiveFiftyOne.php b/CRM/Upgrade/Incremental/php/FiveFiftyOne.php index abff73daa5..3acc87c862 100644 --- a/CRM/Upgrade/Incremental/php/FiveFiftyOne.php +++ b/CRM/Upgrade/Incremental/php/FiveFiftyOne.php @@ -88,7 +88,7 @@ class CRM_Upgrade_Incremental_php_FiveFiftyOne extends CRM_Upgrade_Incremental_B * This updates them to hold the name - eg. 'total_amount'. * * @return bool - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public static function convertMappingFieldLabelsToNames(): bool { // Contribution fields.... diff --git a/CRM/Upgrade/Incremental/php/FiveFortyOne.php b/CRM/Upgrade/Incremental/php/FiveFortyOne.php index dcf9e4c422..2096ae551b 100644 --- a/CRM/Upgrade/Incremental/php/FiveFortyOne.php +++ b/CRM/Upgrade/Incremental/php/FiveFortyOne.php @@ -107,7 +107,7 @@ class CRM_Upgrade_Incremental_php_FiveFortyOne extends CRM_Upgrade_Incremental_B * * @return bool * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function installCustomSearches(CRM_Queue_TaskContext $ctx) { // Install via direct SQL manipulation. Note that: diff --git a/CRM/Upgrade/Incremental/php/FiveFortySeven.php b/CRM/Upgrade/Incremental/php/FiveFortySeven.php index 7fcf0bfcc8..b28ab38604 100644 --- a/CRM/Upgrade/Incremental/php/FiveFortySeven.php +++ b/CRM/Upgrade/Incremental/php/FiveFortySeven.php @@ -96,7 +96,6 @@ class CRM_Upgrade_Incremental_php_FiveFortySeven extends CRM_Upgrade_Incremental * @param \CRM_Queue_TaskContext $ctx * * @return bool - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\NotImplementedException */ diff --git a/CRM/Upgrade/Incremental/php/FiveThirty.php b/CRM/Upgrade/Incremental/php/FiveThirty.php index 3faabda7e5..60a95bb351 100644 --- a/CRM/Upgrade/Incremental/php/FiveThirty.php +++ b/CRM/Upgrade/Incremental/php/FiveThirty.php @@ -33,7 +33,6 @@ class CRM_Upgrade_Incremental_php_FiveThirty extends CRM_Upgrade_Incremental_Bas * * @return bool * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public static function installFinancialAcls(CRM_Queue_TaskContext $ctx) { diff --git a/CRM/Upgrade/Incremental/php/FiveTwentyFour.php b/CRM/Upgrade/Incremental/php/FiveTwentyFour.php index b34afcf7b0..96a970526b 100644 --- a/CRM/Upgrade/Incremental/php/FiveTwentyFour.php +++ b/CRM/Upgrade/Incremental/php/FiveTwentyFour.php @@ -40,7 +40,7 @@ class CRM_Upgrade_Incremental_php_FiveTwentyFour extends CRM_Upgrade_Incremental * * @return bool * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function installCreditNotes(CRM_Queue_TaskContext $ctx) { // Install via direct SQL manipulation. Note that: diff --git a/CRM/Upgrade/Incremental/php/FiveTwentyNine.php b/CRM/Upgrade/Incremental/php/FiveTwentyNine.php index b862968647..c52b0a5883 100644 --- a/CRM/Upgrade/Incremental/php/FiveTwentyNine.php +++ b/CRM/Upgrade/Incremental/php/FiveTwentyNine.php @@ -93,7 +93,6 @@ class CRM_Upgrade_Incremental_php_FiveTwentyNine extends CRM_Upgrade_Incremental * * @return bool * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public static function installEventCart(CRM_Queue_TaskContext $ctx) { diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php index 71f6d29712..d5306243e7 100644 --- a/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@ -820,7 +820,7 @@ FROM `civicrm_dashboard_contact` JOIN `civicrm_contact` WHERE civicrm_dashboard_ try { civicrm_api3('Extension', 'disable', ['key' => 'com.klangsoft.flexiblejobs']); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // just ignore if the extension isn't installed } diff --git a/CRM/Utils/API/MatchOption.php b/CRM/Utils/API/MatchOption.php index fa87a1cf8b..97301161b9 100644 --- a/CRM/Utils/API/MatchOption.php +++ b/CRM/Utils/API/MatchOption.php @@ -128,14 +128,14 @@ class CRM_Utils_API_MatchOption implements API_Wrapper { * * @return array * revised $createParams, including 'id' if known - * @throws API_Exception + * @throws CRM_Core_Exception */ public function match($entity, $createParams, $keys, $isMandatory) { $getParams = $this->createGetParams($createParams, $keys); $getResult = civicrm_api3($entity, 'get', $getParams); if ($getResult['count'] == 0) { if ($isMandatory) { - throw new API_Exception("Failed to match existing record"); + throw new CRM_Core_Exception("Failed to match existing record"); } // OK, don't care return $createParams; @@ -146,7 +146,7 @@ class CRM_Utils_API_MatchOption implements API_Wrapper { return $createParams; } else { - throw new API_Exception("Ambiguous match criteria"); + throw new CRM_Core_Exception("Ambiguous match criteria"); } } diff --git a/CRM/Utils/API/ReloadOption.php b/CRM/Utils/API/ReloadOption.php index 3e320d5c14..0ed1c48691 100644 --- a/CRM/Utils/API/ReloadOption.php +++ b/CRM/Utils/API/ReloadOption.php @@ -80,7 +80,7 @@ class CRM_Utils_API_ReloadOption implements API_Wrapper { ]; $reloadResult = civicrm_api3($apiRequest['entity'], 'get', $params); if ($reloadResult['is_error']) { - throw new API_Exception($reloadResult['error_message']); + throw new CRM_Core_Exception($reloadResult['error_message']); } $result['values'][$id] = array_merge($result['values'][$id], $reloadResult['values'][$result['id']]); return $result; @@ -95,7 +95,7 @@ class CRM_Utils_API_ReloadOption implements API_Wrapper { return $result; default: - throw new API_Exception("Unknown reload mode " . $reloadMode); + throw new CRM_Core_Exception("Unknown reload mode " . $reloadMode); } } diff --git a/CRM/Utils/Check/Component.php b/CRM/Utils/Check/Component.php index 2f57004ade..f09877f284 100644 --- a/CRM/Utils/Check/Component.php +++ b/CRM/Utils/Check/Component.php @@ -23,7 +23,7 @@ abstract class CRM_Utils_Check_Component { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function getChecksConfig() { @@ -65,7 +65,7 @@ abstract class CRM_Utils_Check_Component { * * @return CRM_Utils_Check_Message[] * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function checkAll($requestedChecks = [], $includeDisabled = FALSE) { @@ -105,7 +105,7 @@ abstract class CRM_Utils_Check_Component { * * @return bool * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function isDisabled($method) { diff --git a/CRM/Utils/Check/Component/FinancialTypeAcls.php b/CRM/Utils/Check/Component/FinancialTypeAcls.php index 05601e0778..ef9a475b1c 100644 --- a/CRM/Utils/Check/Component/FinancialTypeAcls.php +++ b/CRM/Utils/Check/Component/FinancialTypeAcls.php @@ -18,7 +18,7 @@ class CRM_Utils_Check_Component_FinancialTypeAcls extends CRM_Utils_Check_Compon /** * @return CRM_Utils_Check_Message[] - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ public static function checkFinancialAclReport() { $messages = []; diff --git a/CRM/Utils/Check/Component/Schema.php b/CRM/Utils/Check/Component/Schema.php index 2d6a8aa728..a61288d4b3 100644 --- a/CRM/Utils/Check/Component/Schema.php +++ b/CRM/Utils/Check/Component/Schema.php @@ -20,7 +20,7 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component { * Check defined indices exist. * * @return CRM_Utils_Check_Message[] - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function checkIndices() { $messages = []; @@ -106,7 +106,7 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component { 'options' => ['limit' => 0], ]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { $messages[] = new CRM_Utils_Check_Message( __FUNCTION__, ts('The smart group check was unable to run. This is likely to because a database upgrade is pending.'), @@ -149,7 +149,7 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component { $url = CRM_Utils_System::url('civicrm/admin/custom/group/field/update', "action=update&reset=1&gid={$customField['custom_group_id']}&id={$field['cfid']}", TRUE); $fieldName = '' . $customField['label'] . ''; } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { $fieldName = '' . ts('Deleted') . ' - ' . ts('Field ID %1', [1 => $field['cfid']]) . ' '; } } diff --git a/CRM/Utils/Check/Message.php b/CRM/Utils/Check/Message.php index 7c425b30d7..8aae42516f 100644 --- a/CRM/Utils/Check/Message.php +++ b/CRM/Utils/Check/Message.php @@ -246,7 +246,7 @@ class CRM_Utils_Check_Message { * * @return bool * TRUE means hidden, FALSE means visible. - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private function checkStatusPreference() { $this->hiddenUntil = FALSE; diff --git a/CRM/Utils/OptionBag.php b/CRM/Utils/OptionBag.php index c6c1ca20e9..3061573ba7 100644 --- a/CRM/Utils/OptionBag.php +++ b/CRM/Utils/OptionBag.php @@ -42,7 +42,7 @@ class CRM_Utils_OptionBag implements ArrayAccess, IteratorAggregate, Countable { * @param string|null $type * @param mixed $default * @return mixed - * @throws API_Exception + * @throws CRM_Core_Exception */ public function get($key, $type = NULL, $default = NULL) { if (!array_key_exists($key, $this->data)) { @@ -56,7 +56,7 @@ class CRM_Utils_OptionBag implements ArrayAccess, IteratorAggregate, Countable { return $r; } else { - throw new \API_Exception(ts("Could not find valid value for %1 (%2)", [1 => $key, 2 => $type])); + throw new \CRM_Core_Exception(ts("Could not find valid value for %1 (%2)", [1 => $key, 2 => $type])); } } diff --git a/CRM/Utils/SQL/BaseParamQuery.php b/CRM/Utils/SQL/BaseParamQuery.php index 960dec4cbf..e2f5fe5fe5 100644 --- a/CRM/Utils/SQL/BaseParamQuery.php +++ b/CRM/Utils/SQL/BaseParamQuery.php @@ -125,7 +125,7 @@ class CRM_Utils_SQL_BaseParamQuery implements ArrayAccess { $values[$valueKey] = 'NULL'; } elseif (!is_numeric($value)) { - //throw new API_Exception("Failed encoding non-numeric value" . var_export(array($m[0] => $values), TRUE)); + //throw new CRM_Core_Exception("Failed encoding non-numeric value" . var_export(array($m[0] => $values), TRUE)); throw new CRM_Core_Exception("Failed encoding non-numeric value (" . $m[0] . ")"); } } diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index ed97fbf803..8e354309c7 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -1595,7 +1595,7 @@ class CRM_Utils_Token { * @param array $knownTokens * @param bool $escapeSmarty * @return string - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function replaceCaseTokens($caseId, $str, $knownTokens = NULL, $escapeSmarty = FALSE): string { if (strpos($str, '{case.') === FALSE) { @@ -1617,7 +1617,7 @@ class CRM_Utils_Token { * @param string $token * @param array $entityArray * @return string - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getApiTokenReplacement($entity, $token, $entityArray) { if (!isset($entityArray[$token])) { @@ -1770,7 +1770,7 @@ class CRM_Utils_Token { ]); $value = CRM_Utils_Money::format($value, NULL, NULL, TRUE); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // we can anticipate we will get an error if the minimum fee is set to 'NULL' because of the way the // api handles NULL (4.4) $value = 0; -- 2.25.1