TMExtras::id()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Type message extras data
4
 * User: moyo
5
 * Date: 27/02/2018
6
 * Time: 2:45 PM
7
 */
8
9
namespace Carno\NSQ\Chips;
10
11
trait TMExtras
12
{
13
    /**
14
     * @var string
15
     */
16
    private $id = '';
17
18
    /**
19
     * @var int
20
     */
21
    private $attempts = 0;
22
23
    /**
24
     * @var int
25
     */
26
    private $timestamp = 0;
27
28
    /**
29
     * @param string $id
30
     * @param int $attempts
31
     * @param int $timestamp
32
     * @return static
33
     */
34
    public function meta(string $id, int $attempts, int $timestamp) : self
35
    {
36
        $this->id = $id;
37
        $this->attempts = $attempts;
38
        $this->timestamp = $timestamp;
39
        return $this;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function id() : string
46
    {
47
        return $this->id;
48
    }
49
50
    /**
51
     * @return int
52
     */
53
    public function attempts() : int
54
    {
55
        return $this->attempts;
56
    }
57
58
    /**
59
     * @return int
60
     */
61
    public function timestamp() : int
62
    {
63
        return $this->timestamp;
64
    }
65
}
66