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 |
||
32 | 3 | public function __invoke(Guard $guard, VerifyRequest $request): Response |
|
33 | { |
||
34 | /** @var \App\Models\User $user */ |
||
35 | 3 | $user = $guard->user(); |
|
36 | |||
37 | 3 | $email = $request->input('email'); |
|
38 | |||
39 | try { |
||
40 | 3 | if ($this->dispensary->verify($user, $email, $request->input('token'))) { |
|
41 | 1 | $user->update(['email' => $email]); |
|
42 | |||
43 | 1 | return $this->responseFactory->noContent(Response::HTTP_OK); |
|
44 | } |
||
45 | |||
46 | 1 | return $this->responseFactory->noContent(Response::HTTP_BAD_REQUEST); |
|
47 | 1 | } catch (TokenExpiredException $e) { |
|
48 | 1 | return $this->responseFactory->noContent(Response::HTTP_BAD_REQUEST); |
|
49 | } |
||
52 |