| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/enoikio/modules/token/src/ |
Upload File : |
<?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 = []);
}