Time   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 37
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A now() 0 4 1
A date() 0 4 1
A microtime() 0 4 1
A strtotime() 0 4 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