Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
34 | 8 | public function handle(Request $request, Closure $next, string ...$grantables) |
|
35 | { |
||
36 | 8 | $authenticated = $request->user(); |
|
37 | |||
38 | 8 | if ($this->isAuthorizedRequestFor($authenticated)($grantables)) { |
|
39 | 4 | return $next($request); |
|
40 | } |
||
41 | |||
42 | 4 | $this->event->dispatch(new UnauthorizedOwner($authenticated, $grantables)); |
|
43 | |||
44 | 4 | throw new UnauthorizedOwnerException($authenticated); |
|
45 | } |
||
54 |