| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 2 | protected function run( |
|
| 24 | ServerRequestInterface $request, |
||
| 25 | JsonEnabledResponseInterface $response, |
||
| 26 | array $args |
||
| 27 | ): ResponseInterface { |
||
| 28 | 2 | $item = $this->artItemIdentifier->identify( |
|
| 29 | 2 | sprintf( |
|
| 30 | 2 | '%s-%d', |
|
| 31 | 2 | $args['type'] ?? '', |
|
| 32 | 2 | $args['id'] ?? 0 |
|
| 33 | 2 | ) |
|
| 34 | 2 | ); |
|
| 35 | |||
| 36 | 2 | if ($item === null) { |
|
| 37 | 1 | return $response->withStatus(Http::NOT_FOUND); |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | return $this->cachedArtResponseProvider->withCachedArt($response, $item); |
|
| 41 | } |
||
| 43 |