| Conditions | 3 |
| Paths | 3 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function run() |
||
| 27 | { |
||
| 28 | $request = Yii::$app->getRequest(); |
||
| 29 | $modelClass = $this->modelClass; |
||
| 30 | /* @var $model \yii\db\ActiveRecordInterface */ |
||
| 31 | $model = new $modelClass([ |
||
| 32 | 'scenario' => $this->scenario, |
||
| 33 | ]); |
||
| 34 | $model->load( |
||
| 35 | $request->getQueryParams() + $request->getBodyParams(), |
||
| 36 | '' |
||
| 37 | ); |
||
| 38 | $this->checkAccess($model, $request->getQueryParams()); |
||
| 39 | $model->load($this->parseFileAttributes(), ''); |
||
| 40 | if ($model->save()) { |
||
| 41 | $response = Yii::$app->getResponse(); |
||
| 42 | $response->setStatusCode(201); |
||
| 43 | $response->getHeaders()->set('Location', $model->getSelfLink()); |
||
|
|
|||
| 44 | } elseif (!$model->hasErrors()) { |
||
| 45 | throw new ServerErrorHttpException( |
||
| 46 | 'Failed to create the object for unknown reason.' |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | |||
| 50 | return $model; |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
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.