Remove deprecated token function
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 8 Nov 2022 20:29:56 +0000 (09:29 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 8 Nov 2022 20:29:56 +0000 (09:29 +1300)
CRM/Utils/Token.php

index 8e354309c718aeba035c9c91ea268cc499e52965..42dd02bee4a1b1c92a5d2d032411f4b5858abaf0 100644 (file)
@@ -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.
    *