| Total Lines | 27 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function createSegmentFromArray(array $rawArray): SegmentInterface |
||
| 25 | { |
||
| 26 | if ($this->customKey !== $rawArray[0]) { |
||
| 27 | return $this->defaultFactory->createSegmentFromArray($rawArray); |
||
| 28 | } |
||
| 29 | |||
| 30 | return new /** @psalm-immutable */ class($rawArray) implements SegmentInterface { |
||
| 31 | private array $rawArray; |
||
| 32 | |||
| 33 | public function __construct(array $rawArray) |
||
| 34 | { |
||
| 35 | $this->rawArray = $rawArray; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function tag(): string |
||
| 39 | { |
||
| 40 | return (string) $this->rawArray[0]; |
||
| 41 | } |
||
| 42 | |||
| 43 | public function subId(): string |
||
| 44 | { |
||
| 45 | return (string) $this->rawArray[1]; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function rawValues(): array |
||
| 49 | { |
||
| 50 | return $this->rawArray; |
||
| 51 | } |
||
| 55 |