From 79594ce72d201139f98a9baa4605acd8b2357f72 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 18 Sep 2021 12:18:46 +1200 Subject: [PATCH] Annotate deprecated functions This also adds noisy deprecation to 2 functions replaceComponentTokens - I thnk this has been out of use for a while. Only 1 reference in universe from and extension that does not seem to be maintained (commits in 2016 from Sarah Gladstone). replaceOrgTokens - no core calls since 5.39 --- CRM/Utils/Token.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index c2ec7615ab..d7d3dfdac3 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -296,6 +296,7 @@ class CRM_Utils_Token { * The processed string */ public static function replaceOrgTokens($str, &$org, $html = FALSE, $escapeSmarty = FALSE) { + CRM_Core_Error::deprecatedFunctionWarning('token processor'); self::$_tokens['org'] = array_merge( array_keys(CRM_Contact_BAO_Contact::importableFields('Organization')), @@ -776,6 +777,7 @@ class CRM_Utils_Token { * @param string $entityType * @return string * html parsed through smarty + * @deprecated */ public static function parseThroughSmarty($tokenHtml, $entity, $entityType = 'contact') { if (defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY) { @@ -822,6 +824,8 @@ class CRM_Utils_Token { * * this routine will remove the extra backslashes and braces * + * @deprecated + * * @param $str ref to the string that will be scanned and modified */ public static function unescapeTokens(&$str) { @@ -1021,8 +1025,11 @@ class CRM_Utils_Token { * * @return string * The processed string + * + * @deprecated */ - public static function &replaceComponentTokens(&$str, $contact, $components, $escapeSmarty = FALSE, $returnEmptyToken = TRUE) { + public static function replaceComponentTokens(&$str, $contact, $components, $escapeSmarty = FALSE, $returnEmptyToken = TRUE) { + CRM_Core_Error::deprecatedFunctionWarning('use the token processor'); if (!is_array($components) || empty($contact)) { return $str; } @@ -1594,6 +1601,8 @@ class CRM_Utils_Token { /** * Generic function for formatting token replacement for an api field * + * @deprecated + * * @param string $entity * @param string $token * @param array $entityArray -- 2.25.1