DateDetail   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
c 0
b 0
f 0
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 7 2
1
<?php
2
3
namespace kalanis\kw_table\core\Table\Columns;
4
5
6
use kalanis\kw_connect\core\Interfaces\IRow;
7
8
9
/**
10
 * Class DateDetail
11
 * @package kalanis\kw_table\core\Table\Columns
12
 * Extended date format in title
13
 */
14
class DateDetail extends Date
15
{
16 2
    public function getValue(IRow $source)
17
    {
18 2
        $result = $this->value($source, $this->sourceName);
19 2
        if (empty($result)) {
20 1
            return 0;
21
        } else {
22 1
            return '<span title="' . date('Y-m-d H:i:s', intval($result)) . '">' . date($this->format, intval($result)) . '</span>';
23
        }
24
    }
25
}
26