| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 1 | protected function run( |
|
| 28 | ServerRequestInterface $request, |
||
| 29 | JsonEnabledResponseInterface $response, |
||
| 30 | array $args |
||
| 31 | ): ResponseInterface { |
||
| 32 | 1 | $history = $this->playbackHistoryRepository->findBy( |
|
| 33 | 1 | [], |
|
| 34 | 1 | ['play_date' => 'DESC'], |
|
| 35 | 1 | self::HISTORY_LIMIT |
|
| 36 | 1 | ); |
|
| 37 | |||
| 38 | 1 | $result = []; |
|
| 39 | |||
| 40 | 1 | foreach ($history as $item) { |
|
| 41 | 1 | $result[] = $this->resultItemFactory->createPlaybackHistoryItem($item); |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | return $response->withJson( |
|
| 45 | 1 | ['items' => $result], |
|
| 46 | 1 | ); |
|
| 49 |