HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/fabricas.colombiatrade.com.co/public_html/modules/contrib/token/src/TokenInterface.php
<?php

namespace Drupal\token;

interface TokenInterface {

  /**
   * Returns metadata describing supported token types.
   *
   * @param $token_type
   *   The token type for which the metadata is required.
   *
   * @return array[]
   *   An array of token type information from hook_token_info() for the
   *   specified token type.
   *
   * @see hook_token_info()
   * @see hook_token_info_alter()
   */
  public function getTypeInfo($token_type);

  /**
   * Returns metadata describing supported a token.
   *
   * @param $token_type
   *   The token type for which the metadata is required.
   * @param $token
   *   The token name for which the metadata is required.
   *
   * @return array[]
   *   An array of information from hook_token_info() for the specified token.
   *
   * @see hook_token_info()
   * @see hook_token_info_alter()
   */
  public function getTokenInfo($token_type, $token);

  /**
   * Get a list of token types that can be used without any context (global).
   *
   * @return array[]
   *   An array of global token types.
   */
  public function getGlobalTokenTypes();

  /**
   * Validate an array of tokens based on their token type.
   *
   * @param string $type
   *   The type of tokens to validate (e.g. 'node', etc.)
   * @param string[] $tokens
   *   A keyed array of tokens, and their original raw form in the source text.
   *
   * @return string[]
   *   An array with the invalid tokens in their original raw forms.
   */
  function getInvalidTokens($type, $tokens);

  /**
   * Validate tokens in raw text based on possible contexts.
   *
   * @param string|string[] $value
   *   A string with the raw text containing the raw tokens, or an array of
   *   tokens from token_scan().
   * @param string[] $valid_types
   *   An array of token types that will be used when token replacement is
   *   performed.
   *
   * @return string[]
   *   An array with the invalid tokens in their original raw forms.
   */
  public function getInvalidTokensByContext($value, array $valid_types = []);
}