Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function __invoke(Guard $guard, User $user): Response |
||
22 | 1 | { |
|
23 | 1 | /** @var User $authenticatedUser */ |
|
24 | $authenticatedUser = $guard->user(); |
||
25 | |||
26 | if ($user->is($authenticatedUser)) { |
||
27 | return $this->responseFactory->noContent(Response::HTTP_CONFLICT); |
||
28 | } |
||
29 | |||
30 | $user->delete(); |
||
31 | |||
32 | return $this->responseFactory->noContent(Response::HTTP_OK); |
||
33 | } |
||
35 |