From d587ecd97a30136475cc36c9e938c14d7e579d34 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 9 Nov 2022 09:29:56 +1300 Subject: [PATCH] Remove deprecated token function --- CRM/Utils/Token.php | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index 8e354309c7..42dd02bee4 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -1039,48 +1039,6 @@ class CRM_Utils_Token { return $match[1]; } - /** - * Find and replace tokens for each component. - * - * @param string $str - * The string to search. - * @param array $contact - * Associative array of contact properties. - * @param array $components - * A list of tokens that are known to exist in the email body. - * - * @param bool $escapeSmarty - * @param bool $returnEmptyToken - * - * @return string - * The processed string - * - * @deprecated - */ - 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; - } - - foreach ($components as $name => $tokens) { - if (!is_array($tokens) || empty($tokens)) { - continue; - } - - foreach ($tokens as $token) { - if (self::token_match($name, $token, $str) && isset($contact[$name . '.' . $token])) { - self::token_replace($name, $token, $contact[$name . '.' . $token], $str, $escapeSmarty); - } - elseif (!$returnEmptyToken) { - //replacing empty token - self::token_replace($name, $token, "", $str, $escapeSmarty); - } - } - } - return $str; - } - /** * Get array of string tokens. * -- 2.25.1