getRateRooms::__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 getRateRooms
6
{
7
8
    /**
9
     * @var int $intGUID
10
     */
11
    protected $intGUID = null;
12
13
    /**
14
     * @var \DateTime $dtArrivalDate
15
     */
16
    protected $dtArrivalDate = null;
17
18
    /**
19
     * @var \DateTime $dtDepartureDate
20
     */
21
    protected $dtDepartureDate = null;
22
23
    /**
24
     * @var int $intGuestCount
25
     */
26
    protected $intGuestCount = null;
27
28
    /**
29
     * @var int $intRateCodeID
30
     */
31
    protected $intRateCodeID = null;
32
33
    /**
34
     * @var string $strISOLanguage
35
     */
36
    protected $strISOLanguage = null;
37
38
    /**
39
     * @var string $strChildren
40
     */
41
    protected $strChildren = null;
42
43
    /**
44
     * @var string $strAttributes
45
     */
46
    protected $strAttributes = null;
47
48
    /**
49
     * @var string $strLocations
50
     */
51
    protected $strLocations = null;
52
53
    /**
54
     * @var int $intRoomQty
55
     */
56
    protected $intRoomQty = null;
57
58
    /**
59
     * @var string $strAttributeGroupings
60
     */
61
    protected $strAttributeGroupings = null;
62
63
    /**
64
     * @var string $strLocationsGroupings
65
     */
66
    protected $strLocationsGroupings = null;
67
68
    /**
69
     * @param int $intGUID
70
     * @param \DateTime $dtArrivalDate
71
     * @param \DateTime $dtDepartureDate
72
     * @param int $intGuestCount
73
     * @param int $intRateCodeID
74
     * @param string $strISOLanguage
75
     * @param string $strChildren
76
     * @param string $strAttributes
77
     * @param string $strLocations
78
     * @param int $intRoomQty
79
     * @param string $strAttributeGroupings
80
     * @param string $strLocationsGroupings
81
     */
82
    public function __construct($intGUID, \DateTime $dtArrivalDate, \DateTime $dtDepartureDate, $intGuestCount, $intRateCodeID, $strISOLanguage, $strChildren, $strAttributes, $strLocations, $intRoomQty, $strAttributeGroupings, $strLocationsGroupings)
83
    {
84
        $this->intGUID = $intGUID;
85
        $this->dtArrivalDate = $dtArrivalDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $dtArrivalDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $dtArrivalDate.

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...
86
        $this->dtDepartureDate = $dtDepartureDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $dtDepartureDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $dtDepartureDate.

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->intGuestCount = $intGuestCount;
88
        $this->intRateCodeID = $intRateCodeID;
89
        $this->strISOLanguage = $strISOLanguage;
90
        $this->strChildren = $strChildren;
91
        $this->strAttributes = $strAttributes;
92
        $this->strLocations = $strLocations;
93
        $this->intRoomQty = $intRoomQty;
94
        $this->strAttributeGroupings = $strAttributeGroupings;
95
        $this->strLocationsGroupings = $strLocationsGroupings;
96
    }
97
98
    /**
99
     * @return int
100
     */
101
    public function getIntGUID()
102
    {
103
        return $this->intGUID;
104
    }
105
106
    /**
107
     * @param int $intGUID
108
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
109
     */
110
    public function setIntGUID($intGUID)
111
    {
112
        $this->intGUID = $intGUID;
113
        return $this;
114
    }
115
116
    /**
117
     * @return \DateTime
118
     */
119
    public function getDtArrivalDate()
120
    {
121
        if ($this->dtArrivalDate == null) {
122
            return null;
123
        } else {
124
            try {
125
                return new \DateTime($this->dtArrivalDate);
126
            } catch (\Exception $e) {
127
                return false;
128
            }
129
        }
130
    }
131
132
    /**
133
     * @param \DateTime $dtArrivalDate
134
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
135
     */
136
    public function setDtArrivalDate(\DateTime $dtArrivalDate)
137
    {
138
        $this->dtArrivalDate = $dtArrivalDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $dtArrivalDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $dtArrivalDate.

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...
139
        return $this;
140
    }
141
142
    /**
143
     * @return \DateTime
144
     */
145
    public function getDtDepartureDate()
146
    {
147
        if ($this->dtDepartureDate == null) {
148
            return null;
149
        } else {
150
            try {
151
                return new \DateTime($this->dtDepartureDate);
152
            } catch (\Exception $e) {
153
                return false;
154
            }
155
        }
156
    }
157
158
    /**
159
     * @param \DateTime $dtDepartureDate
160
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
161
     */
162
    public function setDtDepartureDate(\DateTime $dtDepartureDate)
163
    {
164
        $this->dtDepartureDate = $dtDepartureDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $dtDepartureDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $dtDepartureDate.

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...
165
        return $this;
166
    }
167
168
    /**
169
     * @return int
170
     */
171
    public function getIntGuestCount()
172
    {
173
        return $this->intGuestCount;
174
    }
175
176
    /**
177
     * @param int $intGuestCount
178
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
179
     */
180
    public function setIntGuestCount($intGuestCount)
181
    {
182
        $this->intGuestCount = $intGuestCount;
183
        return $this;
184
    }
185
186
    /**
187
     * @return int
188
     */
189
    public function getIntRateCodeID()
190
    {
191
        return $this->intRateCodeID;
192
    }
193
194
    /**
195
     * @param int $intRateCodeID
196
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
197
     */
198
    public function setIntRateCodeID($intRateCodeID)
199
    {
200
        $this->intRateCodeID = $intRateCodeID;
201
        return $this;
202
    }
203
204
    /**
205
     * @return string
206
     */
207
    public function getStrISOLanguage()
208
    {
209
        return $this->strISOLanguage;
210
    }
211
212
    /**
213
     * @param string $strISOLanguage
214
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
215
     */
216
    public function setStrISOLanguage($strISOLanguage)
217
    {
218
        $this->strISOLanguage = $strISOLanguage;
219
        return $this;
220
    }
221
222
    /**
223
     * @return string
224
     */
225
    public function getStrChildren()
226
    {
227
        return $this->strChildren;
228
    }
229
230
    /**
231
     * @param string $strChildren
232
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
233
     */
234
    public function setStrChildren($strChildren)
235
    {
236
        $this->strChildren = $strChildren;
237
        return $this;
238
    }
239
240
    /**
241
     * @return string
242
     */
243
    public function getStrAttributes()
244
    {
245
        return $this->strAttributes;
246
    }
247
248
    /**
249
     * @param string $strAttributes
250
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
251
     */
252
    public function setStrAttributes($strAttributes)
253
    {
254
        $this->strAttributes = $strAttributes;
255
        return $this;
256
    }
257
258
    /**
259
     * @return string
260
     */
261
    public function getStrLocations()
262
    {
263
        return $this->strLocations;
264
    }
265
266
    /**
267
     * @param string $strLocations
268
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
269
     */
270
    public function setStrLocations($strLocations)
271
    {
272
        $this->strLocations = $strLocations;
273
        return $this;
274
    }
275
276
    /**
277
     * @return int
278
     */
279
    public function getIntRoomQty()
280
    {
281
        return $this->intRoomQty;
282
    }
283
284
    /**
285
     * @param int $intRoomQty
286
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
287
     */
288
    public function setIntRoomQty($intRoomQty)
289
    {
290
        $this->intRoomQty = $intRoomQty;
291
        return $this;
292
    }
293
294
    /**
295
     * @return string
296
     */
297
    public function getStrAttributeGroupings()
298
    {
299
        return $this->strAttributeGroupings;
300
    }
301
302
    /**
303
     * @param string $strAttributeGroupings
304
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
305
     */
306
    public function setStrAttributeGroupings($strAttributeGroupings)
307
    {
308
        $this->strAttributeGroupings = $strAttributeGroupings;
309
        return $this;
310
    }
311
312
    /**
313
     * @return string
314
     */
315
    public function getStrLocationsGroupings()
316
    {
317
        return $this->strLocationsGroupings;
318
    }
319
320
    /**
321
     * @param string $strLocationsGroupings
322
     * @return \Gueststream\PMS\IQWare\API\getRateRooms
323
     */
324
    public function setStrLocationsGroupings($strLocationsGroupings)
325
    {
326
        $this->strLocationsGroupings = $strLocationsGroupings;
327
        return $this;
328
    }
329
}
330