Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function actionCheck($variable) |
||
20 | { |
||
21 | $class = \Yii::$app->controller->module->{$variable}; |
||
22 | if (!$class) { |
||
23 | throw new HttpException(401, "Значение '$variable' не установлено"); |
||
24 | } |
||
25 | $interfaceTest = InterfaceTest::findByClass($class); |
||
26 | $interfaceClass = ModuleHelper::getPhpDocInterfaceProperty($variable); |
||
27 | if ($interfaceTest->load(\Yii::$app->request->post())) { |
||
28 | if ($interfaceTest->save()) { |
||
29 | $this->refresh(); |
||
30 | } else { |
||
31 | \Yii::$app->session->setFlash('error', Html::errorSummary($interfaceTest)); |
||
|
|||
32 | } |
||
33 | } |
||
34 | return $this->render('check', [ |
||
35 | 'variable' => $variable, |
||
36 | 'class' => $class, |
||
37 | 'interfaceTest' => $interfaceTest, |
||
38 | 'interfaceClass' => $interfaceClass |
||
39 | ]); |
||
41 | } |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.