Code Duplication    Length = 10-10 lines in 2 locations

src/grid/ChargeGridView.php 1 location

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

src/grid/BillGridView.php 1 location

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