TimestampEpoch::timestamp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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