| Conditions | 5 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 5.0729 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | 5 | public function signup( |
|
| 23 | AuthService $authService, |
||
| 24 | 5 | ServerRequestInterface $request, |
|
| 25 | 5 | SignupForm $signupForm |
|
| 26 | ): ResponseInterface { |
||
| 27 | if (!$authService->isGuest()) { |
||
| 28 | 5 | return $this->redirectToMain(); |
|
| 29 | } |
||
| 30 | |||
| 31 | if ($request->getMethod() === Method::POST |
||
| 32 | && $signupForm->load($request->getParsedBody()) |
||
| 33 | && $signupForm->signup() |
||
| 34 | 5 | ) { |
|
| 35 | return $this->redirectToMain(); |
||
| 36 | } |
||
| 37 | |||
| 38 | 5 | return $this->viewRenderer->render('signup', ['formModel' => $signupForm]); |
|
| 39 | } |
||
| 46 |