| Total Complexity | 6 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class LiteralFactory implements LiteralFactoryInterface |
||
| 16 | { |
||
| 17 | |||
| 18 | public function createScalar(NodeValueListInterface $source, $value): ValueListInterface |
||
| 21 | } |
||
| 22 | |||
| 23 | public function createArray(NodeValueListInterface $source, ValueListInterface ...$valueLists): ValueListInterface |
||
| 24 | { |
||
| 25 | $createArrayElement = function (array $elements): ValueInterface { |
||
| 26 | return new LiteralArrayValue(...$elements); |
||
| 27 | }; |
||
| 28 | |||
| 29 | return new ValueList( |
||
| 30 | $source->getIndexMap(), |
||
| 31 | ...array_map( |
||
| 32 | $createArrayElement, |
||
| 33 | $this->buildArrayElementLists($source, ...$valueLists) |
||
| 34 | ) |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | private function buildArrayElementLists(NodeValueListInterface $source, ValueListInterface ...$valueLists): array |
||
| 51 | } |
||
| 52 | } |
||
| 53 |