Total Complexity | 6 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | final class SegmentedValues |
||
11 | { |
||
12 | /** @var array */ |
||
13 | private $list; |
||
14 | |||
15 | 7 | public static function fromRaw(array $rawArrays): self |
|
16 | { |
||
17 | 7 | $segments = []; |
|
18 | |||
19 | 7 | foreach ($rawArrays as $rawArray) { |
|
20 | 7 | $segments[] = SegmentFactory::factory($rawArray); |
|
21 | } |
||
22 | |||
23 | 7 | return self::fromSegmentInterfaces($segments); |
|
24 | } |
||
25 | |||
26 | /** @return SegmentInterface[] */ |
||
27 | 7 | public function list(): array |
|
28 | { |
||
29 | 7 | return $this->list; |
|
30 | } |
||
31 | |||
32 | 7 | private function addSegment(SegmentInterface $segment): void |
|
33 | { |
||
34 | 7 | $this->list[] = $segment; |
|
35 | 7 | } |
|
36 | |||
37 | 7 | private static function fromSegmentInterfaces(array $segments): self |
|
46 | } |
||
47 | } |
||
48 |