| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | 5 | protected function getItem( |
|
| 23 | ServerRequestInterface $request, |
||
| 24 | array $args |
||
| 25 | ): ?FavoriteAbleInterface { |
||
| 26 | /** @var array<string, mixed> $body */ |
||
| 27 | 5 | $body = $request->getParsedBody(); |
|
| 28 | |||
| 29 | 5 | $itemId = (int) ($body['itemId'] ?? 0); |
|
| 30 | |||
| 31 | 5 | return match ((string) ($args['type'] ?? '')) { |
|
| 32 | 5 | 'song' => $this->songRepository->find($itemId), |
|
| 33 | 5 | default => null, |
|
| 34 | }; |
||
| 37 |