| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function byIdAction($id, $fileClass) |
||
| 25 | { |
||
| 26 | $file = $this->get('bengor_file.' . $fileClass . '.by_id_query')->__invoke( |
||
| 27 | new FileOfIdQuery($id) |
||
| 28 | ); |
||
| 29 | |||
| 30 | if (!$file) { |
||
| 31 | return new JsonResponse([ |
||
| 32 | 'error' => 'Does not exist any file with the given "%s" id', |
||
| 33 | ], 404); |
||
| 34 | } |
||
| 35 | |||
| 36 | return new JsonResponse($file); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |