| Conditions | 4 |
| Paths | 5 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function run(array $args, \DomElement $element = null) { |
||
| 16 | $json = $args[0]; |
||
| 17 | |||
| 18 | if ($this->isJsonFile($json)) { |
||
| 19 | $path = $this->filePath->getFilePath($json); |
||
| 20 | if (!file_exists($path)) throw new \Exception('File does not exist at: ' . $path); |
||
| 21 | $json = file_get_contents($path); |
||
| 22 | } |
||
| 23 | |||
| 24 | $map = json_decode($json, true); |
||
| 25 | |||
| 26 | if (!is_array($map)) throw new \Exception('Could not decode json: ' . json_last_error_msg()); |
||
| 27 | |||
| 28 | return $map; |
||
| 29 | } |
||
| 30 | |||
| 35 |