ChangeEventHeader::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 9
dl 0
loc 11
rs 9.9666

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
namespace SForce\Wsdl;
4
5
class ChangeEventHeader
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $entityName = null;
11
12
    /**
13
     * @var string[]
14
     */
15
    protected $recordIds = null;
16
17
    /**
18
     * @var int
19
     */
20
    protected $commitTimestamp = null;
21
22
    /**
23
     * @var int
24
     */
25
    protected $commitNumber = null;
26
27
    /**
28
     * @var string
29
     */
30
    protected $commitUser = null;
31
32
    /**
33
     * @var string[]
34
     */
35
    protected $diffFields = null;
36
37
    /**
38
     * @var changeEventType
39
     */
40
    protected $changeType = null;
41
42
    /**
43
     * @var string
44
     */
45
    protected $changeOrigin = null;
46
47
    /**
48
     * @var string
49
     */
50
    protected $transactionKey = null;
51
52
    /**
53
     * @var int
54
     */
55
    protected $sequenceNumber = null;
56
57
    /**
58
     * @var string[]
59
     */
60
    protected $nulledFields = null;
61
62
    /**
63
     * @param string $entityName
64
     * @param string[] $recordIds
65
     * @param int $commitTimestamp
66
     * @param int $commitNumber
67
     * @param string $commitUser
68
     * @param changeEventType $changeType
69
     * @param string $changeOrigin
70
     * @param string $transactionKey
71
     * @param int $sequenceNumber
72
     */
73
    public function __construct($entityName = null, array $recordIds = null, $commitTimestamp = null, $commitNumber = null, $commitUser = null, $changeType = null, $changeOrigin = null, $transactionKey = null, $sequenceNumber = null)
74
    {
75
        $this->entityName = $entityName;
76
        $this->recordIds = $recordIds;
77
        $this->commitTimestamp = $commitTimestamp;
78
        $this->commitNumber = $commitNumber;
79
        $this->commitUser = $commitUser;
80
        $this->changeType = $changeType;
81
        $this->changeOrigin = $changeOrigin;
82
        $this->transactionKey = $transactionKey;
83
        $this->sequenceNumber = $sequenceNumber;
84
    }
85
86
    /**
87
     * @return string
88
     */
89
    public function getEntityName()
90
    {
91
        return $this->entityName;
92
    }
93
94
    /**
95
     * @param string $entityName
96
     * @return \SForce\Wsdl\ChangeEventHeader
97
     */
98
    public function setEntityName($entityName)
99
    {
100
        $this->entityName = $entityName;
101
        return $this;
102
    }
103
104
    /**
105
     * @return string[]
106
     */
107
    public function getRecordIds()
108
    {
109
        return $this->recordIds;
110
    }
111
112
    /**
113
     * @param string[] $recordIds
114
     * @return \SForce\Wsdl\ChangeEventHeader
115
     */
116
    public function setRecordIds(array $recordIds)
117
    {
118
        $this->recordIds = $recordIds;
119
        return $this;
120
    }
121
122
    /**
123
     * @return int
124
     */
125
    public function getCommitTimestamp()
126
    {
127
        return $this->commitTimestamp;
128
    }
129
130
    /**
131
     * @param int $commitTimestamp
132
     * @return \SForce\Wsdl\ChangeEventHeader
133
     */
134
    public function setCommitTimestamp($commitTimestamp)
135
    {
136
        $this->commitTimestamp = $commitTimestamp;
137
        return $this;
138
    }
139
140
    /**
141
     * @return int
142
     */
143
    public function getCommitNumber()
144
    {
145
        return $this->commitNumber;
146
    }
147
148
    /**
149
     * @param int $commitNumber
150
     * @return \SForce\Wsdl\ChangeEventHeader
151
     */
152
    public function setCommitNumber($commitNumber)
153
    {
154
        $this->commitNumber = $commitNumber;
155
        return $this;
156
    }
157
158
    /**
159
     * @return string
160
     */
161
    public function getCommitUser()
162
    {
163
        return $this->commitUser;
164
    }
165
166
    /**
167
     * @param string $commitUser
168
     * @return \SForce\Wsdl\ChangeEventHeader
169
     */
170
    public function setCommitUser($commitUser)
171
    {
172
        $this->commitUser = $commitUser;
173
        return $this;
174
    }
175
176
    /**
177
     * @return string[]
178
     */
179
    public function getDiffFields()
180
    {
181
        return $this->diffFields;
182
    }
183
184
    /**
185
     * @param string[] $diffFields
186
     * @return \SForce\Wsdl\ChangeEventHeader
187
     */
188
    public function setDiffFields(array $diffFields = null)
189
    {
190
        $this->diffFields = $diffFields;
191
        return $this;
192
    }
193
194
    /**
195
     * @return changeEventType
196
     */
197
    public function getChangeType()
198
    {
199
        return $this->changeType;
200
    }
201
202
    /**
203
     * @param changeEventType $changeType
204
     * @return \SForce\Wsdl\ChangeEventHeader
205
     */
206
    public function setChangeType($changeType)
207
    {
208
        $this->changeType = $changeType;
209
        return $this;
210
    }
211
212
    /**
213
     * @return string
214
     */
215
    public function getChangeOrigin()
216
    {
217
        return $this->changeOrigin;
218
    }
219
220
    /**
221
     * @param string $changeOrigin
222
     * @return \SForce\Wsdl\ChangeEventHeader
223
     */
224
    public function setChangeOrigin($changeOrigin)
225
    {
226
        $this->changeOrigin = $changeOrigin;
227
        return $this;
228
    }
229
230
    /**
231
     * @return string
232
     */
233
    public function getTransactionKey()
234
    {
235
        return $this->transactionKey;
236
    }
237
238
    /**
239
     * @param string $transactionKey
240
     * @return \SForce\Wsdl\ChangeEventHeader
241
     */
242
    public function setTransactionKey($transactionKey)
243
    {
244
        $this->transactionKey = $transactionKey;
245
        return $this;
246
    }
247
248
    /**
249
     * @return int
250
     */
251
    public function getSequenceNumber()
252
    {
253
        return $this->sequenceNumber;
254
    }
255
256
    /**
257
     * @param int $sequenceNumber
258
     * @return \SForce\Wsdl\ChangeEventHeader
259
     */
260
    public function setSequenceNumber($sequenceNumber)
261
    {
262
        $this->sequenceNumber = $sequenceNumber;
263
        return $this;
264
    }
265
266
    /**
267
     * @return string[]
268
     */
269
    public function getNulledFields()
270
    {
271
        return $this->nulledFields;
272
    }
273
274
    /**
275
     * @param string[] $nulledFields
276
     * @return \SForce\Wsdl\ChangeEventHeader
277
     */
278
    public function setNulledFields(array $nulledFields = null)
279
    {
280
        $this->nulledFields = $nulledFields;
281
        return $this;
282
    }
283
}
284