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