| Conditions | 5 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | public function handle($request, Closure $next, ...$permission) |
||
| 36 | { |
||
| 37 | if (!$this->auth->check() && in_array('allowGuest', $permission)) { |
||
| 38 | return $next($request); |
||
| 39 | } |
||
| 40 | |||
| 41 | if ($this->auth->check() && $this->auth->user()->hasPermission($permission[0])) { |
||
| 42 | return $next($request); |
||
| 43 | } |
||
| 44 | |||
| 45 | throw new PermissionDeniedException($permission[0]); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.