Conditions | 6 |
Paths | 7 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function handle($request, Closure $next, $roleOrPermission) |
||
13 | { |
||
14 | if (Auth::guest()) { |
||
15 | throw UnauthorizedException::notLoggedIn(); |
||
16 | } |
||
17 | |||
18 | $rolesOrPermissions = is_array($roleOrPermission) |
||
19 | ? $roleOrPermission |
||
20 | : explode('|', $roleOrPermission); |
||
21 | |||
22 | try { |
||
23 | if (! Auth::user()->hasAnyRole($rolesOrPermissions) || ! Auth::user()->hasAnyPermission($rolesOrPermissions)) { |
||
24 | throw UnauthorizedException::forRolesOrPermissions($rolesOrPermissions); |
||
25 | } |
||
26 | } catch (PermissionDoesNotExist $exception) { |
||
27 | } |
||
28 | |||
29 | return $next($request); |
||
30 | } |
||
31 | } |
||
32 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.