Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
29 | public function actionSend() |
||
30 | { |
||
31 | $form = new FeedbackForm(); |
||
32 | |||
33 | if ($form->load(Yii::$app->request->post()) && $form->validate()) { |
||
34 | /** @var FeedbackSender $sender */ |
||
35 | Yii::createObject(DebugSessionSaver::class, [$form->session_tag])->run(); |
||
36 | $sender = Yii::createObject(FeedbackSender::class, [$form]); |
||
37 | |||
38 | return $this->render('sent', [ |
||
39 | 'model' => $form, |
||
40 | 'success' => $sender->send(), |
||
41 | ]); |
||
42 | } |
||
43 | |||
44 | return $this->redirect(Yii::$app->getHomeUrl()); |
||
|
|||
45 | } |
||
46 | |||
53 |
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: