Time::now()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace BrainExe\Core\Util;
4
5
use BrainExe\Core\Annotations\Service;
6
7
/**
8
 * @Service
9
 * @api
10
 */
11
class Time
12
{
13
14
    /**
15
     * @return int
16
     */
17 1
    public function now() : int
18
    {
19 1
        return time();
20
    }
21
22
    /**
23
     * @param string $format
24
     * @return string
25
     */
26 1
    public function date($format) : string
27
    {
28 1
        return date($format);
29
    }
30
31
    /**
32
     * @return int
33
     */
34 1
    public function microtime() : int
35
    {
36 1
        return microtime(true);
37
    }
38
39
    /**
40
     * @param string $string
41
     * @return int
42
     */
43 1
    public function strtotime(string $string)
44
    {
45 1
        return strtotime($string);
46
    }
47
}
48