| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| 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', 'Mail box'), |
||
| 24 | ], |
||
| 25 | [ |
||
| 26 | 'label' => Yii::t('hipanel:hosting', 'Mail alias'), |
||
| 27 | 'color' => '#CCCCFF', |
||
| 28 | 'rule' => $this->model->type === 'forward_only', |
||
|
|
|||
| 29 | ], |
||
| 30 | [ |
||
| 31 | 'label' => Yii::t('hipanel:hosting', 'Mail box with aliases'), |
||
| 32 | 'color' => '#FFFF99', |
||
| 33 | 'rule' => $this->model->type === 'mailbox_with_forwards', |
||
| 34 | ], |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |
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: