TimestampEpoch   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A timestamp() 0 3 1
A generateTimestamp() 0 3 1
1
<?php
2
3
namespace ZoiloMora\ElasticAPM\Events\Common;
4
5
/**
6
 * Timestamp Epoch
7
 * Object with 'timestamp' property.
8
 */
9
trait TimestampEpoch
10
{
11
    /**
12
     * Recorded time of the event, UTC based and formatted as microseconds since Unix epoch
13
     *
14
     * @var int|null
15
     */
16
    private $timestamp;
17
18
    /**
19
     * @return int|null
20
     */
21 2
    public function timestamp()
22
    {
23 2
        return $this->timestamp;
24
    }
25
26
    /**
27
     * @return int
28
     */
29 22
    private function generateTimestamp()
30
    {
31 22
        return (int) (microtime(true) * 1000000);
32
    }
33
}
34