Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
19 | public function items() |
||
20 | { |
||
21 | return [ |
||
22 | [ |
||
23 | 'label' => Yii::t('hipanel:hosting', 'Shared'), |
||
24 | ], |
||
25 | [ |
||
26 | 'label' => Yii::t('hipanel:hosting', 'Free'), |
||
27 | 'color' => '#AAFFAA', |
||
28 | 'rule' => $this->model->type === 'free', |
||
|
|||
29 | ], |
||
30 | [ |
||
31 | 'label' => Yii::t('hipanel:hosting', 'Dedicated'), |
||
32 | 'color' => '#CCCCFF', |
||
33 | 'rule' => $this->model->type === 'dedicated', |
||
34 | ], |
||
35 | [ |
||
36 | 'label' => Yii::t('hipanel:hosting', 'System'), |
||
37 | ], |
||
38 | [ |
||
39 | 'label' => Yii::t('hipanel:hosting', 'Blocked'), |
||
40 | ], |
||
41 | ]; |
||
42 | } |
||
43 | } |
||
44 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: