TokenProcessor
FinalYes
Table of Contents
Methods
- __construct() : mixed
- getReplacement() : string
- Retrieves the replacement for a given token, generating it if it doesn't exist.
- getReplacements() : array<string, string>
- Retrieves all replacements mapped to their original tokens.
- hideTokens() : string
- Hides all tokens in the provided text by replacing them with their unique replacements.
Methods
__construct()
public
__construct(array<string|int, HiddenToken> ...$tokens) : mixed
Parameters
- $tokens : array<string|int, HiddenToken>
getReplacement()
Retrieves the replacement for a given token, generating it if it doesn't exist.
public
getReplacement(HiddenToken $token) : string
Parameters
- $token : HiddenToken
Tags
Return values
stringgetReplacements()
Retrieves all replacements mapped to their original tokens.
public
getReplacements() : array<string, string>
Return values
array<string, string> —Associative array of original token values to replacements.
hideTokens()
Hides all tokens in the provided text by replacing them with their unique replacements.
public
hideTokens(string $text) : string
Parameters
- $text : string