Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | private function verifyJSON(string $file): bool |
||
40 | { |
||
41 | // basic check on the JSON. |
||
42 | $json = file_get_contents($file); |
||
43 | try { |
||
44 | $configuration = json_decode($json, true, 512, JSON_THROW_ON_ERROR); |
||
|
|||
45 | } catch (Exception|JsonException $e) { |
||
46 | $message = sprintf('The importer can\'t import: could not decode the JSON in the config file: %s', $e->getMessage()); |
||
47 | Log::error($message); |
||
48 | |||
49 | return false; |
||
50 | |||
51 | } |
||
52 | |||
53 | return true; |
||
54 | } |
||
56 | } |