| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | 4 | public function create(string $segmentId, string $segmentType, array $criteria): Segment |
|
| 14 | { |
||
| 15 | 4 | if (StrictMatchingSegment::NAME === $segmentType) { |
|
| 16 | 1 | return new StrictMatchingSegment($segmentId, $criteria); |
|
| 17 | } |
||
| 18 | 3 | if (IdentitySegment::NAME === $segmentType) { |
|
| 19 | 1 | return new IdentitySegment($segmentId, $criteria); |
|
| 20 | } |
||
| 21 | 2 | if (InCollectionMatchingSegment::NAME === $segmentType) { |
|
| 22 | 1 | return new InCollectionMatchingSegment($segmentId, $criteria); |
|
| 23 | } |
||
| 24 | |||
| 25 | 1 | throw InvalidSegmentTypeGiven::withType($segmentType); |
|
| 26 | } |
||
| 37 |