Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function run() |
||
26 | { |
||
27 | Event::trigger(self::class, static::EVENT_BEFORE_LOGOUT, new ActionEvent($this, ['sender' => $this])); |
||
28 | |||
29 | Yii::$app->user->logout(); |
||
30 | |||
31 | Event::trigger(self::class, static::EVENT_AFTER_LOGOUT, new ActionEvent($this, ['sender' => $this])); |
||
32 | |||
33 | return $this->controller->goHome(); |
||
|
|||
34 | } |
||
35 | } |
||
36 |
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: