Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
60 | protected function getPermissions() |
||
61 | { |
||
62 | try { |
||
63 | return $this->cache->rememberForever('permissions.policies', function () { |
||
64 | return Permission::with('roles')->get(); |
||
|
|||
65 | }); |
||
66 | } catch (\Exception $exception) { |
||
67 | $this->cache->forget('permissions.policies'); |
||
68 | |||
69 | return new Collection; |
||
70 | } |
||
71 | } |
||
72 | } |
||
73 |
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: