Completed
Pull Request — master (#6)
by Ronaldo
05:01
created

BaseEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace WSW\SiftScience\Events;
4
5
use DateTime;
6
7
/**
8
 * Class BaseEvent
9
 *
10
 * @package WSW\SiftScience\Events
11
 * @author Ronaldo Matos Rodrigues <[email protected]>
12
 */
13
abstract class BaseEvent
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $type;
19
20
    /**
21
     * @var string
22
     */
23
    protected $apiKey;
24
25
    /**
26
     * @var string
27
     */
28
    protected $userId;
29
30
    /**
31
     * @var string
32
     */
33
    protected $sessionId;
34
35
    /**
36
     * @var string
37
     */
38
    protected $ip;
39
40
    /**
41
     * @var \DateTime
42
     */
43
    protected $time;
44
45
    /**
46
     * @return string
47
     */
48 16
    public function getType()
49
    {
50 16
        return $this->type;
51
    }
52
53
    /**
54
     * @return string
55
     */
56 14
    public function getApiKey()
57
    {
58 14
        return $this->apiKey;
59
    }
60
61
    /**
62
     * @param string $apiKey
63
     *
64
     * @return $this
65
     */
66 14
    public function setApiKey($apiKey)
67
    {
68 14
        $this->apiKey = $apiKey;
69
70 14
        return $this;
71
    }
72
73
    /**
74
     * @return string
75
     */
76 14
    public function getUserId()
77
    {
78 14
        return $this->userId;
79
    }
80
81
    /**
82
     * @param string $userId
83
     *
84
     * @return $this
85
     */
86 1
    public function setUserId($userId)
87
    {
88 1
        $this->userId = $userId;
89
90 1
        return $this;
91
    }
92
93
    /**
94
     * @return string
95
     */
96 12
    public function getSessionId()
97
    {
98 12
        return $this->sessionId;
99
    }
100
101
    /**
102
     * @param string $sessionId
103
     *
104
     * @return $this
105
     */
106 1
    public function setSessionId($sessionId)
107
    {
108 1
        $this->sessionId = $sessionId;
109
110 1
        return $this;
111
    }
112
113
    /**
114
     * @return string
115
     */
116 14
    public function getIp()
117
    {
118 14
        return $this->ip;
119
    }
120
121
    /**
122
     * @param string $ip
123
     *
124
     * @return $this
125
     */
126 1
    public function setIp($ip)
127
    {
128 1
        $this->ip = $ip;
129
130 1
        return $this;
131
    }
132
133
    /**
134
     * @return \DateTime
135
     */
136 14
    public function getTime()
137
    {
138 14
        return $this->time;
139
    }
140
141
    /**
142
     * @param \DateTime $time
143
     *
144
     * @return $this
145
     */
146 1
    public function setTime(DateTime $time)
147
    {
148 1
        $this->time = $time;
149
150 1
        return $this;
151
    }
152
}
153