@@ -12,13 +12,17 @@ |
||
| 12 | 12 | |
| 13 | 13 | if (trim($json)[0] != '{') { |
| 14 | 14 | $path = $this->baseDir . $json; |
| 15 | - if (!file_exists($path)) throw new \Exception('File does not exist at: ' . $path); |
|
| 15 | + if (!file_exists($path)) { |
|
| 16 | + throw new \Exception('File does not exist at: ' . $path); |
|
| 17 | + } |
|
| 16 | 18 | $json = file_get_contents($json); |
| 17 | 19 | } |
| 18 | 20 | |
| 19 | 21 | $map = json_decode($json, true); |
| 20 | 22 | |
| 21 | - if (!is_array($map)) throw new \Exception('Could not decode json: ' . json_last_error_msg()); |
|
| 23 | + if (!is_array($map)) { |
|
| 24 | + throw new \Exception('Could not decode json: ' . json_last_error_msg()); |
|
| 25 | + } |
|
| 22 | 26 | |
| 23 | 27 | return $map; |
| 24 | 28 | } |