| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function init() |
||
| 22 | { |
||
| 23 | parent::init(); |
||
| 24 | |||
| 25 | if (Yii::$app->user->getIsGuest()) { |
||
| 26 | $this->seller = Yii::$app->params['seller']; |
||
|
|
|||
| 27 | } else { |
||
| 28 | $this->seller = Yii::$app->user->identity->seller; |
||
| 29 | $this->client = Yii::$app->user->identity->login; |
||
| 30 | } |
||
| 31 | |||
| 32 | $this->object = 'server'; |
||
| 33 | } |
||
| 34 | |||
| 43 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.