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 | 3099 | public function __construct(TextNormalizerInterface $innerNormalizer) |
|
25 | { |
||
26 | 3099 | $this->innerNormalizer = $innerNormalizer; |
|
27 | 3099 | } |
|
28 | |||
29 | 2988 | public function clearHistory(): void |
|
30 | { |
||
31 | 2988 | $this->alreadyUsed = []; |
|
32 | 2988 | } |
|
33 | |||
34 | /** |
||
35 | * {@inheritDoc} |
||
36 | * |
||
37 | * @psalm-allow-private-mutation |
||
38 | */ |
||
39 | 117 | public function normalize(string $text, array $context = []): string |
|
56 | } |
||
57 | } |
||
58 |