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