Completed
Push — master ( 9fa729...e15551 )
by Dmitry
13:25
created

PreOrderGridView   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 39
ccs 0
cts 34
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B columns() 0 36 1
1
<?php
2
/**
3
 * Server module for HiPanel.
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-server
6
 * @package   hipanel-module-server
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\grid;
12
13
use hipanel\grid\ActionColumn;
14
use hipanel\modules\server\helpers\ServerHelper;
15
use hipanel\modules\server\widgets\OSFormatter;
16
use Yii;
17
18
class PreOrderGridView extends \hipanel\grid\BoxedGridView
19
{
20
    protected function columns()
21
    {
22
        return array_merge(parent::columns(), [
0 ignored issues
show
Bug introduced by
The method columns() does not exist on hipanel\grid\BoxedGridView. Did you maybe mean column()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
23
            'tech_details' => [
24
                'format' => 'raw',
25
                'label' => Yii::t('hipanel:finance:change', 'Operation details'),
26
                'value' => function ($model) {
27
                    $params = $model->params;
28
                    return OSFormatter::widget([
29
                        'osimages' => ServerHelper::getOsimages($params['tariff_type']),
30
                        'imageName' => $params['osimage'],
31
                        'infoCircle' => false,
32
                    ]);
33
                },
34
            ],
35
            'user_comment' => [
36
                'filterAttribute' => 'user_comment_like',
37
                'value' => function ($model) {
38
                    return $model->user_comment;
39
                },
40
            ],
41
            'tech_comment' => [
42
                'attribute' => 'tech_comment',
43
            ],
44
            'time' => [
45
                'value' => function ($model) {
46
                    return Yii::$app->formatter->asDatetime($model->time);
47
                },
48
            ],
49
            'actions' => [
50
                'class' => ActionColumn::class,
51
                'template' => '{view}',
52
                'header' => Yii::t('hipanel', 'Actions'),
53
            ],
54
        ]);
55
    }
56
}
57