Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
16 | 7 | public static function fromRaw( |
|
17 | array $rawArrays, |
||
18 | ?CustomSegmentFactoryInterface $customSegmentsFactory = null |
||
19 | ): self { |
||
20 | 7 | $factory = new SegmentFactory($customSegmentsFactory); |
|
21 | |||
22 | 7 | $self = new self(); |
|
23 | 7 | $segments = []; |
|
24 | |||
25 | 7 | foreach ($rawArrays as $rawArray) { |
|
26 | 7 | $segments[] = $factory->segmentFromArray($rawArray); |
|
27 | } |
||
28 | |||
29 | 7 | foreach ($segments as $segment) { |
|
30 | 7 | $self->addSegment($segment); |
|
31 | } |
||
32 | |||
33 | 7 | return $self; |
|
34 | } |
||
47 |