| Total Complexity | 7 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class SpecificationExtension implements ValueObjectInterface |
||
| 9 | { |
||
| 10 | private $extraFields; |
||
| 11 | |||
| 12 | public function __construct(array $extraFields) |
||
| 13 | { |
||
| 14 | $res = []; |
||
| 15 | foreach ($extraFields as $fieldName => $extraField) { |
||
| 16 | if (stripos($fieldName, 'x-') === 0) { |
||
| 17 | $res[strtolower($fieldName)] = $extraField; |
||
| 18 | } else { |
||
| 19 | $res['x-' . strtolower($fieldName)] = $extraField; |
||
| 20 | } |
||
| 21 | } |
||
| 22 | $this->extraFields = $res; |
||
| 23 | } |
||
| 24 | |||
| 25 | public function toNative(): array |
||
| 28 | } |
||
| 29 | |||
| 30 | public function withField(string $fieldName, $fieldValue): self |
||
| 39 | } |
||
| 40 | |||
| 41 | public static function fromNative($value) |
||
| 46 |