Code Duplication    Length = 10-10 lines in 2 locations

src/grid/ChargeGridView.php 1 location

@@ 19-28 (lines=10) @@
16
            'type_label' => [
17
                'label' => Yii::t('hipanel', 'Type'),
18
                'format' => 'html',
19
                'value' => function ($model) {
20
                    static $colors = [
21
                        'correction' => 'normal',
22
                        'exchange' => 'warning',
23
                        'deposit' => 'success',
24
                    ];
25
                    $color = $colors[$model->type] ?: 'muted';
26
27
                    return Html::tag('b', Yii::t('hipanel:finance', $model->type_label), ['class' => "text-$color"]);
28
                },
29
            ],
30
            'sum' => [
31
                'class' => CurrencyColumn::class,

src/grid/BillGridView.php 1 location

@@ 101-110 (lines=10) @@
98
                'contentOptions' => function ($model) {
99
                    return ['class' => 'text-right'];
100
                },
101
                'value' => function ($model) {
102
                    static $colors = [
103
                        'correction' => 'normal',
104
                        'exchange' => 'warning',
105
                        'deposit' => 'success',
106
                    ];
107
                    $color = $colors[$model->gtype] ?: 'muted';
108
109
                    return Html::tag('b', Yii::t('hipanel:finance', $model->type_label), ['class' => "text-$color"]);
110
                },
111
            ],
112
            'description' => [
113
                'attribute' => 'descr',