UniqueSlugNormalizer
in package
implements
UniqueSlugNormalizerInterface
FinalYes
Table of Contents
Interfaces
- UniqueSlugNormalizerInterface
- Creates a normalized version of the given input text
Properties
- $alreadyUsed : array<string, bool>
- $innerNormalizer : TextNormalizerInterface
Methods
- __construct() : mixed
- clearHistory() : void
- Called by the Environment whenever the configured scope changes
- normalize() : string
Properties
$alreadyUsed
private
array<string, bool>
$alreadyUsed
= []
$innerNormalizer
private
TextNormalizerInterface
$innerNormalizer
Methods
__construct()
public
__construct(TextNormalizerInterface $innerNormalizer) : mixed
Parameters
- $innerNormalizer : TextNormalizerInterface
clearHistory()
Called by the Environment whenever the configured scope changes
public
clearHistory() : void
Currently, this will only be called PER_DOCUMENT.
normalize()
public
normalize(string $text[, array<string|int, mixed> $context = [] ]) : string
Parameters
- $text : string
-
The text to normalize
- $context : array<string|int, mixed> = []
-
Additional context about the text being normalized (optional)
$context may include (but is not required to include) the following:
prefix- A string prefix to prepend to each normalized resultlength- The requested maximum lengthnode- The node we're normalizing text for
Implementations do not have to use or respect any information within that $context