| Total Complexity | 5 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 17 | final class UniqueSlugNormalizer implements UniqueSlugNormalizerInterface |
||
| 18 | { |
||
| 19 | /** @var TextNormalizerInterface */ |
||
| 20 | private $innerNormalizer; |
||
| 21 | /** @var array<string, bool> */ |
||
| 22 | private $alreadyUsed = []; |
||
| 23 | |||
| 24 | 3057 | public function __construct(TextNormalizerInterface $innerNormalizer) |
|
| 25 | { |
||
| 26 | 3057 | $this->innerNormalizer = $innerNormalizer; |
|
| 27 | 3057 | } |
|
| 28 | |||
| 29 | 2946 | public function clearHistory(): void |
|
| 30 | { |
||
| 31 | 2946 | $this->alreadyUsed = []; |
|
| 32 | 2946 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritDoc} |
||
| 36 | * |
||
| 37 | * @psalm-allow-private-mutation |
||
| 38 | */ |
||
| 39 | 117 | public function normalize(string $text, array $context = []): string |
|
| 56 | } |
||
| 57 | } |
||
| 58 |