| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 1 | public function indexAction(Request $request) |
|
| 27 | { |
||
| 28 | 1 | $em = $this->getDoctrine()->getManager(); |
|
| 29 | 1 | $admin = $em->getRepository(Admin::class)->findOneBy(['id' => $this->getUser()->getId()]); |
|
| 30 | 1 | $editForm = $this->createForm(AdminType::class, $admin); |
|
| 31 | 1 | $editForm->handleRequest($request); |
|
| 32 | 1 | if ($editForm->isSubmitted()) { |
|
| 33 | 1 | if ($editForm->isValid()) { |
|
| 34 | 1 | $em->persist($admin); |
|
| 35 | 1 | $em->flush(); |
|
| 36 | } |
||
| 37 | } |
||
| 38 | return [ |
||
| 39 | 1 | "admin" => $admin, |
|
| 40 | 1 | "editForm" => $editForm->createView(), |
|
| 41 | ]; |
||
| 42 | } |
||
| 43 | } |
||
| 44 |