Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
19 | public function __invoke( |
||
20 | ?string $dataObjectName = null, |
||
21 | $value = null |
||
22 | ): ResponseInterface { |
||
23 | |||
24 | if (!empty($dataObjectName)) { |
||
25 | $data = [ |
||
26 | $dataObjectName => $value, |
||
27 | ]; |
||
28 | } else { |
||
29 | $data = []; |
||
30 | } |
||
31 | |||
32 | return new JsonResponse([ |
||
33 | 'data' => $data, |
||
34 | 'success' => false, |
||
35 | 'msg' => new DangerMessage('Provided data can not be read.'), |
||
36 | ], 400); |
||
37 | } |
||
38 | } |
||
39 |