Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function failedAuthorization() |
||
37 | { |
||
38 | if ($user = auth('web')->user()) { |
||
|
|||
39 | if ($user->active) { |
||
40 | $message = 'You cant post a discussion because either your ministry is out of tokens for this month'; |
||
41 | } else { |
||
42 | $message = 'You are not allowed to posting anything on this app'; |
||
43 | } |
||
44 | } else { |
||
45 | $message = 'You are out of credit, consider upgrading your subscription to post more discussions'; |
||
46 | } |
||
47 | |||
48 | throw new AuthorizationException($message); |
||
49 | } |
||
50 | } |
||
51 |
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: