Completed
Push — master ( d3bd46...a3b41c )
by Cesar
15s queued 11s
created

Point::setMetricId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DevoraliveCachet\Entity;
4
5
use JMS\Serializer\Annotation as JMS;
6
7
/**
8
 * Class Point
9
 * @package DevoraliveCachet\Entity
10
 */
11
class Point extends Entity
12
{
13
    /**
14
     * @var int
15
     * @JMS\Type("int")
16
     * @JMS\SerializedName("metric_id")
17
     */
18
    protected $metricId;
19
20
    /**
21
     * @var int
22
     * @JMS\Type("int")
23
     * @JMS\SerializedName("value")
24
     */
25
    protected $value;
26
27
    /**
28
     * @var int
29
     * @JMS\Type("int")
30
     * @JMS\SerializedName("timestamp")
31
     */
32
    protected $timestamp;
33
34
    /**
35
     * Point constructor.
36
     */
37
    public function __construct()
38
    {
39
        $this->timestamp = time();
40
    }
41
42
    /**
43
     * @return int
44
     */
45
    public function getMetricId()
46
    {
47
        return $this->metricId;
48
    }
49
50
    /**
51
     * @param int $metricId
52
     *
53
     * @return Point
54
     */
55
    public function setMetricId($metricId)
56
    {
57
        $this->metricId = $metricId;
58
59
        return $this;
60
    }
61
62
    /**
63
     * @return int
64
     */
65
    public function getValue()
66
    {
67
        return $this->value;
68
    }
69
70
    /**
71
     * @param int $value
72
     *
73
     * @return Point
74
     */
75
    public function setValue($value)
76
    {
77
        $this->value = $value;
78
79
        return $this;
80
    }
81
82
    /**
83
     * @return int
84
     */
85
    public function getTimestamp(): int
86
    {
87
        return $this->timestamp;
88
    }
89
}
90