| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 3 | public function setConfig(Request $request) |
|
| 32 | { |
||
| 33 | 3 | $data = json_decode($request->get('data'), true); |
|
| 34 | |||
| 35 | 3 | if (is_null($data)) { |
|
| 36 | 1 | return new JsonResponse(['success' => false], 200); |
|
| 37 | } |
||
| 38 | |||
| 39 | 2 | File::putPhpFile(PIMCORE_CONFIGURATION_DIRECTORY . '/tinypng.php', to_php_data_file_format([ |
|
| 40 | 'config' => [ |
||
| 41 | 2 | 'apiKey' => $data['config.apiKey'] |
|
| 42 | ] |
||
| 43 | ])); |
||
| 44 | 2 | return new JsonResponse(['success' => true], 200); |
|
| 45 | } |
||
| 46 | } |