| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 1 | public function run(): ActiveRecordInterface |
|
| 36 | { |
||
| 37 | /* @var $model ActiveRecordInterface */ |
||
| 38 | 1 | $model = Yii::$app->user->identity; |
|
| 39 | 1 | $model->scenario = $this->scenario; |
|
|
|
|||
| 40 | 1 | $model->load( |
|
| 41 | 1 | Yii::$app->getRequest()->getBodyParams() + $this->parseFileAttributes(), |
|
| 42 | '' |
||
| 43 | ); |
||
| 44 | 1 | if ($model->save() === false && !$model->hasErrors()) { |
|
| 45 | throw new ServerErrorHttpException( |
||
| 46 | 'Failed to update the object for unknown reason.' |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | |||
| 50 | 1 | return $model; |
|
| 51 | } |
||
| 53 |