Conditions | 3 |
Paths | 6 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 4 | public function __invoke(Guard $guard, VerifyRequest $request): Response |
|
27 | { |
||
28 | 4 | /** @var \App\Models\User $user */ |
|
29 | 4 | $user = $guard->user(); |
|
30 | 4 | ||
31 | $email = $request->input('email'); |
||
32 | 3 | ||
33 | try { |
||
34 | if ($this->dispensary->verify($user, $email, $request->input('token'))) { |
||
35 | 3 | $user->update(['email' => $email]); |
|
36 | |||
37 | 3 | return $this->responseFactory->noContent(Response::HTTP_OK); |
|
38 | } |
||
39 | |||
40 | 3 | return $this->responseFactory->noContent(Response::HTTP_BAD_REQUEST); |
|
41 | 1 | } catch (TokenExpiredException $e) { |
|
42 | return $this->responseFactory->noContent(Response::HTTP_BAD_REQUEST); |
||
43 | 1 | } |
|
46 |