carono /
yii2-1c-exchange
| 1 | <?php |
||
| 2 | |||
| 3 | |||
| 4 | namespace carono\exchange1c\controllers; |
||
| 5 | |||
| 6 | |||
| 7 | use carono\exchange1c\helpers\ModuleHelper; |
||
| 8 | use carono\exchange1c\models\InterfaceTest; |
||
| 9 | use yii\helpers\Html; |
||
| 10 | use yii\web\HttpException; |
||
| 11 | |||
| 12 | class InterfaceController extends Controller |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @param string $variable |
||
| 16 | * @return string |
||
| 17 | * @throws HttpException |
||
| 18 | */ |
||
| 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)); |
||
|
0 ignored issues
–
show
|
|||
| 32 | } |
||
| 33 | } |
||
| 34 | return $this->render('check', [ |
||
| 35 | 'variable' => $variable, |
||
| 36 | 'class' => $class, |
||
| 37 | 'interfaceTest' => $interfaceTest, |
||
| 38 | 'interfaceClass' => $interfaceClass |
||
| 39 | ]); |
||
| 40 | } |
||
| 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.