| Conditions | 1 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function segmentFromArray(array $rawArray): SegmentInterface |
||
| 24 | { |
||
| 25 | if ($this->customKey !== $rawArray[0]) { |
||
| 26 | return $this->defaultFactory->segmentFromArray($rawArray); |
||
| 27 | } |
||
| 28 | |||
| 29 | return new class($rawArray) implements SegmentInterface { |
||
| 30 | private array $rawArray; |
||
| 31 | |||
| 32 | public function __construct(array $rawArray) |
||
| 33 | { |
||
| 34 | $this->rawArray = $rawArray; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function name(): string |
||
| 38 | { |
||
| 39 | return $this->rawArray[0]; |
||
| 40 | } |
||
| 41 | |||
| 42 | public function subSegmentKey(): string |
||
| 43 | { |
||
| 44 | return $this->rawArray[1]; |
||
| 45 | } |
||
| 46 | |||
| 47 | public function rawValues(): array |
||
| 48 | { |
||
| 49 | return $this->rawArray; |
||
| 50 | } |
||
| 54 |