Completed
Pull Request — master (#7)
by Ronaldo
01:54
created

BaseEvent::setApiKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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