LogDataColumn::getDataCellValue()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 3
1
<?php
2
namespace backend\components\grid;
3
4
use yii\grid\DataColumn;
5
use yii\helpers\Html;
6
use yii\helpers\Json;
7
use yii\helpers\VarDumper;
8
9
class LogDataColumn extends DataColumn
10
{
11
    /**
12
     * @inheritdoc
13
     */
14
    public function getDataCellValue($model, $key = null, $index = null)
15
    {
16
        $value = parent::getDataCellValue($model, $key, $index);
17
        return $value
18
            ? Html::tag('pre', VarDumper::dumpAsString(Json::decode($value)))
19
            : '&mdash;';
20
    }
21
}
22