Add deprecation warning to functions in renamed classes
authorcolemanw <coleman@civicrm.org>
Sun, 21 May 2023 01:33:50 +0000 (21:33 -0400)
committercolemanw <coleman@civicrm.org>
Tue, 23 May 2023 02:33:18 +0000 (22:33 -0400)
Targeting these particular functions because a universe search shows they are used outside of core.

CRM/ACL/BAO/EntityRole.php
CRM/Dedupe/BAO/DedupeRuleGroup.php
CRM/Dedupe/BAO/Exception.php
CRM/Dedupe/BAO/Rule.php
CRM/Dedupe/BAO/RuleGroup.php

index 3bacbf76396946532fd00bc3c3bba1b2333605b7..5620f6f55e66d7c0c7c3d39c70a8ae907a1a257b 100644 (file)
@@ -16,8 +16,6 @@
  */
 
 /**
- *  Access Control EntityRole.
- *
  * @deprecated
  */
 class CRM_ACL_BAO_EntityRole extends CRM_ACL_BAO_ACLEntityRole {}
index b15000917cff02ebe76052629c227c3f39398b8a..c45e90560a5db1bef9c0f38cbe2f0f20cabc3803 100644 (file)
@@ -555,10 +555,10 @@ class CRM_Dedupe_BAO_DedupeRuleGroup extends CRM_Dedupe_DAO_DedupeRuleGroup {
    *   Individual, Household or Organization.
    *
    *
-   * @return array
+   * @return array|string[]
    *   id => "nice name" of rule group
    */
-  public static function getByType($contactType = NULL) {
+  public static function getByType($contactType = NULL): array {
     $dao = new CRM_Dedupe_DAO_DedupeRuleGroup();
 
     if ($contactType) {
index e3777e7fe6f88d95fd142cb33e182e744ae2c481..ef4081c8a900a78bfcf2778e294638ef4a95f35c 100644 (file)
@@ -16,6 +16,6 @@
  */
 
 /**
- * Manages dedupe exceptions - ie pairs marked as non-duplicates.
+ * @deprecated
  */
 class CRM_Dedupe_BAO_Exception extends CRM_Dedupe_BAO_DedupeException {}
index 0e4d31f94809edf887955ed84c53e868fb861d7a..980b47315048d9e089efffc3cea90c442efb1fc3 100644 (file)
  */
 
 /**
- *
- * @package CRM
- * @copyright CiviCRM LLC https://civicrm.org/licensing
+ * @deprecated
  */
+class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_BAO_DedupeRule {
 
-/**
- * The CiviCRM duplicate discovery engine is based on an
- * algorithm designed by David Strauss <david@fourkitchens.com>.
- */
-class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_BAO_DedupeRule {}
+  /**
+   * @param int $cid
+   * @param int $oid
+   * @deprecated
+   * @return bool
+   */
+  public static function validateContacts($cid, $oid) {
+    CRM_Core_Error::deprecatedFunctionWarning('CRM_Dedupe_BAO_DedupeRule::validateContacts');
+    return parent::validateContacts($cid, $oid);
+  }
+
+  /**
+   * @param array $params
+   * @deprecated
+   * @return array
+   */
+  public static function dedupeRuleFields($params) {
+    CRM_Core_Error::deprecatedFunctionWarning('CRM_Dedupe_BAO_DedupeRule::dedupeRuleFields');
+    return parent::dedupeRuleFields($params);
+  }
+
+}
index 1b70dcbffe598467870b25fc44f2de83d19ea798..2caf83350572e0ee3a994a4b29b4d250213ca14e 100644 (file)
  */
 
 /**
- *
- * @package CRM
- * @copyright CiviCRM LLC https://civicrm.org/licensing
+ * @deprecated
  */
+class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_BAO_DedupeRuleGroup {
 
-/**
- * The CiviCRM duplicate discovery engine is based on an
- * algorithm designed by David Strauss <david@fourkitchens.com>.
- */
-class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_BAO_DedupeRuleGroup {}
+  /**
+   * @deprecated
+   * @param string $contactType
+   * @return array|string[]
+   */
+  public static function getByType($contactType = NULL): array {
+    CRM_Core_Error::deprecatedFunctionWarning('APIv4 DedupeRuleGroup::get');
+    return parent::getByType($contactType);
+  }
+
+}