From: Coleman Watts Date: Fri, 25 Feb 2022 21:09:48 +0000 (-0500) Subject: Copy \Civi\Test\HookInterface to \Civi\Core namespace X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ee44263ea97beff2d3d6b6c13d6a95cc621237fc;p=civicrm-core.git Copy \Civi\Test\HookInterface to \Civi\Core namespace --- diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index ba4a67021d..58b388b733 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -18,7 +18,7 @@ /** * Access Control List */ -class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL implements \Civi\Test\HookInterface { +class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL implements \Civi\Core\HookInterface { /** * Available operations for pseudoconstant. diff --git a/CRM/Campaign/BAO/Survey.php b/CRM/Campaign/BAO/Survey.php index 2d34a5240a..136d81b8af 100644 --- a/CRM/Campaign/BAO/Survey.php +++ b/CRM/Campaign/BAO/Survey.php @@ -18,7 +18,7 @@ /** * Class CRM_Campaign_BAO_Survey. */ -class CRM_Campaign_BAO_Survey extends CRM_Campaign_DAO_Survey implements Civi\Test\HookInterface { +class CRM_Campaign_BAO_Survey extends CRM_Campaign_DAO_Survey implements Civi\Core\HookInterface { /** * Retrieve DB object and copy to defaults array. diff --git a/CRM/Case/BAO/CaseType.php b/CRM/Case/BAO/CaseType.php index 3cc8291001..c3f7457864 100644 --- a/CRM/Case/BAO/CaseType.php +++ b/CRM/Case/BAO/CaseType.php @@ -18,7 +18,7 @@ /** * This class contains the functions for Case Type management. */ -class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType implements \Civi\Test\HookInterface { +class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType implements \Civi\Core\HookInterface { /** * Static field for all the case information that we can potentially export. diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 96c908eb79..940393715b 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact implements Civi\Test\HookInterface { +class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact implements Civi\Core\HookInterface { /** * SQL function used to format the phone_numeric field via trigger. diff --git a/CRM/Contact/BAO/ContactType.php b/CRM/Contact/BAO/ContactType.php index 636173f38e..a881d1f6cf 100644 --- a/CRM/Contact/BAO/ContactType.php +++ b/CRM/Contact/BAO/ContactType.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements \Civi\Test\HookInterface { +class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements \Civi\Core\HookInterface { /** * Retrieve DB object and copy to defaults array. diff --git a/CRM/Contact/BAO/RelationshipCache.php b/CRM/Contact/BAO/RelationshipCache.php index e4f6e6695c..f771072f09 100644 --- a/CRM/Contact/BAO/RelationshipCache.php +++ b/CRM/Contact/BAO/RelationshipCache.php @@ -12,7 +12,7 @@ /** * Class CRM_Contact_BAO_RelationshipCache. */ -class CRM_Contact_BAO_RelationshipCache extends CRM_Contact_DAO_RelationshipCache implements \Civi\Test\HookInterface { +class CRM_Contact_BAO_RelationshipCache extends CRM_Contact_DAO_RelationshipCache implements \Civi\Core\HookInterface { /** * The "mappings" array defines the values to put into `civicrm_relationship_cache` diff --git a/CRM/Contact/BAO/RelationshipType.php b/CRM/Contact/BAO/RelationshipType.php index 0eea40fe5a..349b9d9991 100644 --- a/CRM/Contact/BAO/RelationshipType.php +++ b/CRM/Contact/BAO/RelationshipType.php @@ -18,7 +18,7 @@ use Civi\Core\Event\PreEvent; * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType implements \Civi\Test\HookInterface { +class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType implements \Civi\Core\HookInterface { /** * Retrieve DB object and copy to defaults array. diff --git a/CRM/Core/BAO/Email.php b/CRM/Core/BAO/Email.php index 1261608d23..755f09bd1e 100644 --- a/CRM/Core/BAO/Email.php +++ b/CRM/Core/BAO/Email.php @@ -20,7 +20,7 @@ use Civi\Api4\Email; /** * This class contains functions for email handling. */ -class CRM_Core_BAO_Email extends CRM_Core_DAO_Email implements Civi\Test\HookInterface { +class CRM_Core_BAO_Email extends CRM_Core_DAO_Email implements Civi\Core\HookInterface { use CRM_Contact_AccessTrait; /** diff --git a/CRM/Core/BAO/LocationType.php b/CRM/Core/BAO/LocationType.php index 337dd17279..6d119d7091 100644 --- a/CRM/Core/BAO/LocationType.php +++ b/CRM/Core/BAO/LocationType.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType implements \Civi\Test\HookInterface { +class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType implements \Civi\Core\HookInterface { /** * @var CRM_Core_DAO_LocationType|null diff --git a/CRM/Core/BAO/Managed.php b/CRM/Core/BAO/Managed.php index cac29aa186..124eabfdad 100644 --- a/CRM/Core/BAO/Managed.php +++ b/CRM/Core/BAO/Managed.php @@ -18,7 +18,7 @@ /** * This class contains functions for managed entities. */ -class CRM_Core_BAO_Managed extends CRM_Core_DAO_Managed implements Civi\Test\HookInterface { +class CRM_Core_BAO_Managed extends CRM_Core_DAO_Managed implements Civi\Core\HookInterface { /** * Callback for hook_civicrm_post(). diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index 3a0309766f..d0af287f50 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping implements \Civi\Test\HookInterface { +class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping implements \Civi\Core\HookInterface { /** * Retrieve DB object and copy to defaults array. diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index a94b719c0f..08491c2dba 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -23,7 +23,7 @@ require_once 'Mail/mime.php'; /** * Class CRM_Core_BAO_MessageTemplate. */ -class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate implements \Civi\Test\HookInterface { +class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate implements \Civi\Core\HookInterface { /** * Retrieve DB object and copy to defaults array. diff --git a/CRM/Core/BAO/Note.php b/CRM/Core/BAO/Note.php index 1db4a1aebc..1bd336410a 100644 --- a/CRM/Core/BAO/Note.php +++ b/CRM/Core/BAO/Note.php @@ -18,7 +18,7 @@ /** * BAO object for crm_note table. */ -class CRM_Core_BAO_Note extends CRM_Core_DAO_Note implements \Civi\Test\HookInterface { +class CRM_Core_BAO_Note extends CRM_Core_DAO_Note implements \Civi\Core\HookInterface { use CRM_Core_DynamicFKAccessTrait; /** diff --git a/CRM/Core/BAO/OptionGroup.php b/CRM/Core/BAO/OptionGroup.php index 5c67974666..09e2169423 100644 --- a/CRM/Core/BAO/OptionGroup.php +++ b/CRM/Core/BAO/OptionGroup.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup implements \Civi\Test\HookInterface { +class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup implements \Civi\Core\HookInterface { /** * Retrieve DB object and copy to defaults array. diff --git a/CRM/Core/BAO/Translation.php b/CRM/Core/BAO/Translation.php index 7d3d0c29b3..c7ab686cce 100644 --- a/CRM/Core/BAO/Translation.php +++ b/CRM/Core/BAO/Translation.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Core_BAO_Translation extends CRM_Core_DAO_Translation implements \Civi\Test\HookInterface { +class CRM_Core_BAO_Translation extends CRM_Core_DAO_Translation implements \Civi\Core\HookInterface { use CRM_Core_DynamicFKAccessTrait; diff --git a/CRM/Core/BAO/WordReplacement.php b/CRM/Core/BAO/WordReplacement.php index b4252a8bbe..0cf4af17a4 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -18,7 +18,7 @@ /** * Class CRM_Core_BAO_WordReplacement. */ -class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement implements \Civi\Test\HookInterface { +class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement implements \Civi\Core\HookInterface { /** * Retrieve DB object and copy to defaults array. diff --git a/CRM/Financial/BAO/FinancialAccount.php b/CRM/Financial/BAO/FinancialAccount.php index 19d6b3754f..07198cb149 100644 --- a/CRM/Financial/BAO/FinancialAccount.php +++ b/CRM/Financial/BAO/FinancialAccount.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAccount implements \Civi\Test\HookInterface { +class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAccount implements \Civi\Core\HookInterface { /** * Retrieve DB object and copy to defaults array. diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php index 0bec6c6019..fa9c0e9ee2 100644 --- a/CRM/Financial/BAO/FinancialType.php +++ b/CRM/Financial/BAO/FinancialType.php @@ -17,7 +17,7 @@ use Civi\Api4\EntityFinancialAccount; * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType implements \Civi\Test\HookInterface { +class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType implements \Civi\Core\HookInterface { /** * Static cache holder of available financial types for this session diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index 1fbfc1c9d3..d7e0ac6f6e 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -18,7 +18,7 @@ /** * This class contains payment processor related functions. */ -class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProcessor implements \Civi\Test\HookInterface { +class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProcessor implements \Civi\Core\HookInterface { /** * Static holder for the default payment processor * @var object diff --git a/CRM/Financial/BAO/PaymentProcessorType.php b/CRM/Financial/BAO/PaymentProcessorType.php index eabc80afda..83f0a4491f 100644 --- a/CRM/Financial/BAO/PaymentProcessorType.php +++ b/CRM/Financial/BAO/PaymentProcessorType.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentProcessorType implements \Civi\Test\HookInterface { +class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentProcessorType implements \Civi\Core\HookInterface { /** * Static holder for the default payment processor. diff --git a/CRM/Member/BAO/MembershipStatus.php b/CRM/Member/BAO/MembershipStatus.php index f1850aa12a..5f02f8c598 100644 --- a/CRM/Member/BAO/MembershipStatus.php +++ b/CRM/Member/BAO/MembershipStatus.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus implements \Civi\Test\HookInterface { +class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus implements \Civi\Core\HookInterface { /** * Retrieve DB object and copy to defaults array. diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index f73a0a10c4..7263f8f3c2 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType implements \Civi\Test\HookInterface { +class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType implements \Civi\Core\HookInterface { /** * Static holder for the default Membership Type. diff --git a/CRM/Report/BAO/ReportInstance.php b/CRM/Report/BAO/ReportInstance.php index 9aa00c2e85..930b44aad1 100644 --- a/CRM/Report/BAO/ReportInstance.php +++ b/CRM/Report/BAO/ReportInstance.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance implements Civi\Test\HookInterface { +class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance implements Civi\Core\HookInterface { /** * Takes an associative array and creates an instance object. diff --git a/Civi/Core/Event/EventScanner.php b/Civi/Core/Event/EventScanner.php index 9b6c93daa5..0dc2f2123c 100644 --- a/Civi/Core/Event/EventScanner.php +++ b/Civi/Core/Event/EventScanner.php @@ -66,8 +66,8 @@ class EventScanner { } $listenerMap = []; - // FIXME: Inteface misnomer - if (is_subclass_of($class, '\Civi\Test\HookInterface')) { + // These 2 interfaces do the same thing; one is meant for unit tests and the other for runtime code + if (is_subclass_of($class, '\Civi\Test\HookInterface') || is_subclass_of($class, '\Civi\Core\HookInterface')) { $listenerMap = static::mergeListenerMap($listenerMap, static::findFunctionListeners($class, $self)); } if (is_subclass_of($class, '\Symfony\Component\EventDispatcher\EventSubscriberInterface')) { diff --git a/Civi/Core/HookInterface.php b/Civi/Core/HookInterface.php new file mode 100644 index 0000000000..24592b5035 --- /dev/null +++ b/Civi/Core/HookInterface.php @@ -0,0 +1,39 @@ +