Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 8 |
Ratio | 34.78 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function html(Request $request, Response $response, Admin $app, EntityInterface $entity) |
||
|
|||
14 | { |
||
15 | $id = $request->getAttribute('id'); |
||
16 | |||
17 | $form = static::createForm($entity, $app, $id); |
||
18 | $form->loadFromPsr7($request); |
||
19 | |||
20 | View Code Duplication | if ($form->isValid()) { |
|
21 | $entity->update($id, $form['data']->val()); |
||
22 | |||
23 | return new RedirectResponse($app->getRoute('read', [ |
||
24 | 'entity' => $entity->getName(), |
||
25 | 'id' => $id, |
||
26 | ])); |
||
27 | } |
||
28 | |||
29 | //Render template |
||
30 | return $app['templates']->render('pages/edit', [ |
||
31 | 'entity' => $entity, |
||
32 | 'form' => $form, |
||
33 | 'id' => $id, |
||
34 | ]); |
||
35 | } |
||
36 | } |
||
37 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.