GetReservationsForBilling::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 0
cts 15
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 12
crap 2

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 Gueststream\PMS\IQWare\API;
4
5
class GetReservationsForBilling
6
{
7
8
    /**
9
     * @var int $guid
10
     */
11
    protected $guid = null;
12
13
    /**
14
     * @var int $DateOption
15
     */
16
    protected $DateOption = null;
17
18
    /**
19
     * @var \DateTime $SearchStartDate
20
     */
21
    protected $SearchStartDate = null;
22
23
    /**
24
     * @var \DateTime $SearchEndDate
25
     */
26
    protected $SearchEndDate = null;
27
28
    /**
29
     * @var boolean $IsIncludeRevRoom
30
     */
31
    protected $IsIncludeRevRoom = null;
32
33
    /**
34
     * @var boolean $IsIncludeRevElement
35
     */
36
    protected $IsIncludeRevElement = null;
37
38
    /**
39
     * @var boolean $IsIncludeRevAttribute
40
     */
41
    protected $IsIncludeRevAttribute = null;
42
43
    /**
44
     * @var boolean $IsIncludeRevLocation
45
     */
46
    protected $IsIncludeRevLocation = null;
47
48
    /**
49
     * @var boolean $IsIncludeRevSvcCharge
50
     */
51
    protected $IsIncludeRevSvcCharge = null;
52
53
    /**
54
     * @var boolean $IsIncludeRevSvcChargeALaCarte
55
     */
56
    protected $IsIncludeRevSvcChargeALaCarte = null;
57
58
    /**
59
     * @var boolean $IsIncludeRevElementALaCarte
60
     */
61
    protected $IsIncludeRevElementALaCarte = null;
62
63
    /**
64
     * @var boolean $IsIncludeRevPromoChargers
65
     */
66
    protected $IsIncludeRevPromoChargers = null;
67
68
    /**
69
     * @param int $guid
70
     * @param int $DateOption
71
     * @param \DateTime $SearchStartDate
72
     * @param \DateTime $SearchEndDate
73
     * @param boolean $IsIncludeRevRoom
74
     * @param boolean $IsIncludeRevElement
75
     * @param boolean $IsIncludeRevAttribute
76
     * @param boolean $IsIncludeRevLocation
77
     * @param boolean $IsIncludeRevSvcCharge
78
     * @param boolean $IsIncludeRevSvcChargeALaCarte
79
     * @param boolean $IsIncludeRevElementALaCarte
80
     * @param boolean $IsIncludeRevPromoChargers
81
     */
82
    public function __construct($guid, $DateOption, \DateTime $SearchStartDate, \DateTime $SearchEndDate, $IsIncludeRevRoom, $IsIncludeRevElement, $IsIncludeRevAttribute, $IsIncludeRevLocation, $IsIncludeRevSvcCharge, $IsIncludeRevSvcChargeALaCarte, $IsIncludeRevElementALaCarte, $IsIncludeRevPromoChargers)
83
    {
84
        $this->guid = $guid;
85
        $this->DateOption = $DateOption;
86
        $this->SearchStartDate = $SearchStartDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $SearchStartDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $SearchStartDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
87
        $this->SearchEndDate = $SearchEndDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $SearchEndDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $SearchEndDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
88
        $this->IsIncludeRevRoom = $IsIncludeRevRoom;
89
        $this->IsIncludeRevElement = $IsIncludeRevElement;
90
        $this->IsIncludeRevAttribute = $IsIncludeRevAttribute;
91
        $this->IsIncludeRevLocation = $IsIncludeRevLocation;
92
        $this->IsIncludeRevSvcCharge = $IsIncludeRevSvcCharge;
93
        $this->IsIncludeRevSvcChargeALaCarte = $IsIncludeRevSvcChargeALaCarte;
94
        $this->IsIncludeRevElementALaCarte = $IsIncludeRevElementALaCarte;
95
        $this->IsIncludeRevPromoChargers = $IsIncludeRevPromoChargers;
96
    }
97
98
    /**
99
     * @return int
100
     */
101
    public function getGuid()
102
    {
103
        return $this->guid;
104
    }
105
106
    /**
107
     * @param int $guid
108
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
109
     */
110
    public function setGuid($guid)
111
    {
112
        $this->guid = $guid;
113
        return $this;
114
    }
115
116
    /**
117
     * @return int
118
     */
119
    public function getDateOption()
120
    {
121
        return $this->DateOption;
122
    }
123
124
    /**
125
     * @param int $DateOption
126
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
127
     */
128
    public function setDateOption($DateOption)
129
    {
130
        $this->DateOption = $DateOption;
131
        return $this;
132
    }
133
134
    /**
135
     * @return \DateTime
136
     */
137
    public function getSearchStartDate()
138
    {
139
        if ($this->SearchStartDate == null) {
140
            return null;
141
        } else {
142
            try {
143
                return new \DateTime($this->SearchStartDate);
144
            } catch (\Exception $e) {
145
                return false;
146
            }
147
        }
148
    }
149
150
    /**
151
     * @param \DateTime $SearchStartDate
152
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
153
     */
154
    public function setSearchStartDate(\DateTime $SearchStartDate)
155
    {
156
        $this->SearchStartDate = $SearchStartDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $SearchStartDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $SearchStartDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
157
        return $this;
158
    }
159
160
    /**
161
     * @return \DateTime
162
     */
163
    public function getSearchEndDate()
164
    {
165
        if ($this->SearchEndDate == null) {
166
            return null;
167
        } else {
168
            try {
169
                return new \DateTime($this->SearchEndDate);
170
            } catch (\Exception $e) {
171
                return false;
172
            }
173
        }
174
    }
175
176
    /**
177
     * @param \DateTime $SearchEndDate
178
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
179
     */
180
    public function setSearchEndDate(\DateTime $SearchEndDate)
181
    {
182
        $this->SearchEndDate = $SearchEndDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $SearchEndDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $SearchEndDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
183
        return $this;
184
    }
185
186
    /**
187
     * @return boolean
188
     */
189
    public function getIsIncludeRevRoom()
190
    {
191
        return $this->IsIncludeRevRoom;
192
    }
193
194
    /**
195
     * @param boolean $IsIncludeRevRoom
196
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
197
     */
198
    public function setIsIncludeRevRoom($IsIncludeRevRoom)
199
    {
200
        $this->IsIncludeRevRoom = $IsIncludeRevRoom;
201
        return $this;
202
    }
203
204
    /**
205
     * @return boolean
206
     */
207
    public function getIsIncludeRevElement()
208
    {
209
        return $this->IsIncludeRevElement;
210
    }
211
212
    /**
213
     * @param boolean $IsIncludeRevElement
214
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
215
     */
216
    public function setIsIncludeRevElement($IsIncludeRevElement)
217
    {
218
        $this->IsIncludeRevElement = $IsIncludeRevElement;
219
        return $this;
220
    }
221
222
    /**
223
     * @return boolean
224
     */
225
    public function getIsIncludeRevAttribute()
226
    {
227
        return $this->IsIncludeRevAttribute;
228
    }
229
230
    /**
231
     * @param boolean $IsIncludeRevAttribute
232
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
233
     */
234
    public function setIsIncludeRevAttribute($IsIncludeRevAttribute)
235
    {
236
        $this->IsIncludeRevAttribute = $IsIncludeRevAttribute;
237
        return $this;
238
    }
239
240
    /**
241
     * @return boolean
242
     */
243
    public function getIsIncludeRevLocation()
244
    {
245
        return $this->IsIncludeRevLocation;
246
    }
247
248
    /**
249
     * @param boolean $IsIncludeRevLocation
250
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
251
     */
252
    public function setIsIncludeRevLocation($IsIncludeRevLocation)
253
    {
254
        $this->IsIncludeRevLocation = $IsIncludeRevLocation;
255
        return $this;
256
    }
257
258
    /**
259
     * @return boolean
260
     */
261
    public function getIsIncludeRevSvcCharge()
262
    {
263
        return $this->IsIncludeRevSvcCharge;
264
    }
265
266
    /**
267
     * @param boolean $IsIncludeRevSvcCharge
268
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
269
     */
270
    public function setIsIncludeRevSvcCharge($IsIncludeRevSvcCharge)
271
    {
272
        $this->IsIncludeRevSvcCharge = $IsIncludeRevSvcCharge;
273
        return $this;
274
    }
275
276
    /**
277
     * @return boolean
278
     */
279
    public function getIsIncludeRevSvcChargeALaCarte()
280
    {
281
        return $this->IsIncludeRevSvcChargeALaCarte;
282
    }
283
284
    /**
285
     * @param boolean $IsIncludeRevSvcChargeALaCarte
286
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
287
     */
288
    public function setIsIncludeRevSvcChargeALaCarte($IsIncludeRevSvcChargeALaCarte)
289
    {
290
        $this->IsIncludeRevSvcChargeALaCarte = $IsIncludeRevSvcChargeALaCarte;
291
        return $this;
292
    }
293
294
    /**
295
     * @return boolean
296
     */
297
    public function getIsIncludeRevElementALaCarte()
298
    {
299
        return $this->IsIncludeRevElementALaCarte;
300
    }
301
302
    /**
303
     * @param boolean $IsIncludeRevElementALaCarte
304
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
305
     */
306
    public function setIsIncludeRevElementALaCarte($IsIncludeRevElementALaCarte)
307
    {
308
        $this->IsIncludeRevElementALaCarte = $IsIncludeRevElementALaCarte;
309
        return $this;
310
    }
311
312
    /**
313
     * @return boolean
314
     */
315
    public function getIsIncludeRevPromoChargers()
316
    {
317
        return $this->IsIncludeRevPromoChargers;
318
    }
319
320
    /**
321
     * @param boolean $IsIncludeRevPromoChargers
322
     * @return \Gueststream\PMS\IQWare\API\GetReservationsForBilling
323
     */
324
    public function setIsIncludeRevPromoChargers($IsIncludeRevPromoChargers)
325
    {
326
        $this->IsIncludeRevPromoChargers = $IsIncludeRevPromoChargers;
327
        return $this;
328
    }
329
}
330