| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 2 | protected function run( |
|
| 24 | ServerRequestInterface $request, |
||
| 25 | JsonEnabledResponseInterface $response, |
||
| 26 | array $args |
||
| 27 | ): ResponseInterface { |
||
| 28 | 2 | $stationId = (int) ($args['stationId'] ?? 0); |
|
| 29 | |||
| 30 | 2 | $station = $this->radioStationRepository->find($stationId); |
|
| 31 | |||
| 32 | 2 | $result = false; |
|
| 33 | |||
| 34 | 2 | if ($station !== null) { |
|
| 35 | 1 | $this->radioStationRepository->delete($station); |
|
| 36 | |||
| 37 | 1 | $result = true; |
|
| 38 | } |
||
| 39 | |||
| 40 | 2 | return $response->withJson([ |
|
| 41 | 2 | 'result' => $result, |
|
| 42 | 2 | ]); |
|
| 45 |