Conditions | 5 |
Paths | 3 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | protected function hasDemoAccess(Request $request): bool |
||
31 | { |
||
32 | if (! config('demo-mode.enabled') || in_array($request->ip(), config('demo-mode.authorized_ips')) || auth()->check()) { |
||
|
|||
33 | return true; |
||
34 | } |
||
35 | |||
36 | return ! config('demo-mode.strict_mode') && session()->has('demo_access_route_visited'); |
||
37 | } |
||
38 | } |
||
39 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: