| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function run($id) |
||
| 27 | { |
||
| 28 | /* @var $model ActiveRecord */ |
||
| 29 | $model = $this->findModel($id); |
||
| 30 | |||
| 31 | if ($this->checkAccess) { |
||
| 32 | call_user_func($this->checkAccess, $this->id, $model); |
||
| 33 | } |
||
| 34 | |||
| 35 | $request = Yii::$app->getRequest(); |
||
|
|
|||
| 36 | $model->scenario = $this->scenario; |
||
| 37 | $model->load($request->getBodyParams()); |
||
| 38 | if ($model->save() === false && !$model->hasErrors()) { |
||
| 39 | throw new ServerErrorHttpException('Failed to update the object for unknown reason.'); |
||
| 40 | } |
||
| 41 | |||
| 42 | $this->linkRelationships($model, $request->getBodyParam('relationships')); |
||
| 43 | |||
| 44 | return $model; |
||
| 45 | } |
||
| 46 | } |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.