Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function __invoke(Request $request, Response $response, Admin $app) |
||
15 | { |
||
16 | $format = FormatNegotiator::getFormat($request); |
||
17 | $entity = $app->getEntity($request->getAttribute('entity')); |
||
18 | |||
19 | if ($entity !== null && method_exists($this, $format)) { |
||
20 | return $this->$format($request, $response, $app, $entity); |
||
21 | } |
||
22 | |||
23 | return $response->withStatus(404); |
||
24 | } |
||
25 | |||
52 |