| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 2 | protected function run( |
|
| 25 | ServerRequestInterface $request, |
||
| 26 | JsonEnabledResponseInterface $response, |
||
| 27 | array $args |
||
| 28 | ): ResponseInterface { |
||
| 29 | 2 | $playlistId = (int) ($args['playlistId'] ?? 0); |
|
| 30 | |||
| 31 | 2 | $playlist = $this->playlistRepository->find($playlistId); |
|
| 32 | |||
| 33 | 2 | if ($playlist === null) { |
|
| 34 | 1 | return $response->withStatus(Http::NOT_FOUND); |
|
| 35 | } |
||
| 36 | |||
| 37 | 1 | return $response->withJson( |
|
| 38 | 1 | [ |
|
| 39 | 1 | 'id' => $playlist->getId(), |
|
| 40 | 1 | 'name' => $playlist->getName(), |
|
| 41 | 1 | ] |
|
| 45 |