| Conditions | 3 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | protected function createAndComputeTeamForm(Team $team, Request $request):Response |
||
| 23 | { |
||
| 24 | $form = $this->createForm(TeamRulesSelectorForm::class, $team); |
||
| 25 | |||
| 26 | $form->handleRequest($request); |
||
| 27 | |||
| 28 | if ($form->isSubmitted() and $form->isValid()) { |
||
| 29 | $this->teamHelper->createNewTeamVersion($team); |
||
| 30 | $em = $this->getDoctrine()->getManager(); |
||
| 31 | $em->persist($team); |
||
| 32 | $em->flush(); |
||
| 33 | return $this->redirectToRoute('obblm_team_detail', ['team' => $team->getId()]); |
||
| 34 | } |
||
| 35 | |||
| 36 | return $this->render('@ObblmCore/form/team/create.rules-choice.html.twig', [ |
||
| 37 | 'form' => $form->createView(), |
||
| 38 | 'rule' => $team->getRule(), |
||
| 39 | ]); |
||
| 42 |