Total Complexity | 6 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class ArrayNormalizer extends AbstractNormalizer |
||
8 | { |
||
9 | private string $delimiter = ','; |
||
10 | private StringNormalizer $stringNormalizer; |
||
11 | |||
12 | 2 | public function __construct(?NormalizerInterface $normalizer = null) |
|
13 | { |
||
14 | 2 | $this->stringNormalizer = new StringNormalizer(); |
|
15 | 2 | $this->stringNormalizer->addTrimChar($this->delimiter); |
|
16 | |||
17 | 2 | parent::__construct($normalizer); |
|
18 | 2 | } |
|
19 | |||
20 | 2 | public function normalize(string $value) |
|
23 | } |
||
24 | |||
25 | 2 | protected function getNormalizedValue(string $value): array |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * Sets the delimiter to pass to explode(). Defaults to , (comma). |
||
38 | */ |
||
39 | 1 | public function delimiter(string $delimiter): self |
|
49 |