Passed
Push — master ( 6df11d...8e8817 )
by Julien
05:21
created

BlameAt   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 2 Features 0
Metric Value
eloc 3
c 2
b 2
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDateCallback() 0 4 2
1
<?php
2
3
/**
4
 * This file is part of the Zemit Framework.
5
 *
6
 * (c) Zemit Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zemit\Mvc\Model\Blameable;
13
14
trait BlameAt
15
{
16 4
    public function getDateCallback(string $format, ?int $timestamp = null): \Closure
17
    {
18 4
        return function () use ($format, $timestamp) {
19 4
            return isset($timestamp)? date($format, $timestamp) : date($format);
20 4
        };
21
    }
22
}
23