Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function processData(DataItemInterface $item, ExecutionContext $context): ItemInterface |
||
28 | { |
||
29 | $filename = $item->getData(); |
||
30 | if (is_array($filename)) { |
||
31 | $filename = AssociativeArray::getFromKey($filename, $this->fileKey); |
||
32 | } |
||
33 | |||
34 | if ($this->scoped) { |
||
35 | $data = json_decode($context->getFileSystem()->read($filename), true); |
||
36 | } else { |
||
37 | $data = json_decode(file_get_contents($filename), true); |
||
38 | } |
||
39 | |||
40 | return new MixItem([new GroupedItem(new \ArrayIterator($data)), new FileExtractedItem($item->getData())]); |
||
41 | } |
||
43 |