Conditions | 3 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function init() |
||
28 | { |
||
29 | $this->formatter = Yii::$app->formatter; |
||
|
|||
30 | parent::init(); |
||
31 | $this->number = $this->formatter->asChange($this->number, false, $this->format); |
||
32 | if ($this->number > 0) { |
||
33 | $this->bgCssClass = 'bg-green'; |
||
34 | } elseif ($this->number < 0) { |
||
35 | $this->bgCssClass = 'bg-red'; |
||
36 | } |
||
48 | } |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.