| Conditions | 4 |
| Paths | 4 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | protected function validateValue($value) |
||
| 28 | { |
||
| 29 | if (!is_array($value)) { |
||
| 30 | return [Yii::t('yuncms', 'Invalid value'), []]; |
||
| 31 | } |
||
| 32 | |||
| 33 | foreach ($value as $val) { |
||
| 34 | if ($this->manager->getItem($val) == null) { |
||
| 35 | return [Yii::t('yuncms', 'There is neither role nor permission with name "{0}"', [$val]), []]; |
||
| 36 | } |
||
| 39 | } |
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.