Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 3 | public function create(string $segmentId, string $segmentType, array $payload): ISegment |
|
14 | { |
||
15 | 3 | if (Segment::NAME === $segmentType) { |
|
16 | 1 | return new Segment($segmentId, $payload); |
|
17 | } |
||
18 | 2 | if (IdentitySegment::NAME === $segmentType) { |
|
19 | 1 | return new IdentitySegment($segmentId, $payload); |
|
20 | } |
||
21 | |||
22 | 1 | throw InvalidSegmentTypeGiven::withType($segmentType); |
|
23 | } |
||
33 |