DateDetail::getValue()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
cc 2
nc 2
nop 1
crap 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