Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2.0078 |
Changes | 0 |
1 | <?php |
||
16 | 1 | public function index(): JsonResponse |
|
17 | { |
||
18 | 1 | $settings = config('opendox.documentation_source'); |
|
19 | 1 | $filePath = $settings['save_to'] . '/' . $settings['filename'] . '.json'; |
|
20 | |||
21 | 1 | if (! file_exists($filePath)) { |
|
22 | abort(404, 'Cannot find ' . $filePath); |
||
23 | } |
||
24 | |||
25 | 1 | $content = json_decode( |
|
26 | 1 | file_get_contents($filePath) |
|
27 | ); |
||
28 | |||
29 | 1 | return response()->json($content); |
|
30 | } |
||
32 |