WebRes_GetGroupRegularPricing::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 12
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 9
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 WebRes_GetGroupRegularPricing
6
{
7
8
    /**
9
     * @var int $intGUID
10
     */
11
    protected $intGUID = null;
12
13
    /**
14
     * @var string $LanguageCode
15
     */
16
    protected $LanguageCode = null;
17
18
    /**
19
     * @var int $AccountNo
20
     */
21
    protected $AccountNo = null;
22
23
    /**
24
     * @var \DateTime $dtArrivalDate
25
     */
26
    protected $dtArrivalDate = null;
27
28
    /**
29
     * @var \DateTime $dtDepartureDate
30
     */
31
    protected $dtDepartureDate = null;
32
33
    /**
34
     * @var string $strRateCode
35
     */
36
    protected $strRateCode = null;
37
38
    /**
39
     * @var string $strListOfRoomTypes
40
     */
41
    protected $strListOfRoomTypes = null;
42
43
    /**
44
     * @var TPriceType $PriceType
45
     */
46
    protected $PriceType = null;
47
48
    /**
49
     * @var int $aGuestCount
50
     */
51
    protected $aGuestCount = null;
52
53
    /**
54
     * @param int $intGUID
55
     * @param string $LanguageCode
56
     * @param int $AccountNo
57
     * @param \DateTime $dtArrivalDate
58
     * @param \DateTime $dtDepartureDate
59
     * @param string $strRateCode
60
     * @param string $strListOfRoomTypes
61
     * @param TPriceType $PriceType
62
     * @param int $aGuestCount
63
     */
64
    public function __construct($intGUID, $LanguageCode, $AccountNo, \DateTime $dtArrivalDate, \DateTime $dtDepartureDate, $strRateCode, $strListOfRoomTypes, $PriceType, $aGuestCount)
65
    {
66
        $this->intGUID = $intGUID;
67
        $this->LanguageCode = $LanguageCode;
68
        $this->AccountNo = $AccountNo;
69
        $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...
70
        $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...
71
        $this->strRateCode = $strRateCode;
72
        $this->strListOfRoomTypes = $strListOfRoomTypes;
73
        $this->PriceType = $PriceType;
74
        $this->aGuestCount = $aGuestCount;
75
    }
76
77
    /**
78
     * @return int
79
     */
80
    public function getIntGUID()
81
    {
82
        return $this->intGUID;
83
    }
84
85
    /**
86
     * @param int $intGUID
87
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetGroupRegularPricing
88
     */
89
    public function setIntGUID($intGUID)
90
    {
91
        $this->intGUID = $intGUID;
92
        return $this;
93
    }
94
95
    /**
96
     * @return string
97
     */
98
    public function getLanguageCode()
99
    {
100
        return $this->LanguageCode;
101
    }
102
103
    /**
104
     * @param string $LanguageCode
105
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetGroupRegularPricing
106
     */
107
    public function setLanguageCode($LanguageCode)
108
    {
109
        $this->LanguageCode = $LanguageCode;
110
        return $this;
111
    }
112
113
    /**
114
     * @return int
115
     */
116
    public function getAccountNo()
117
    {
118
        return $this->AccountNo;
119
    }
120
121
    /**
122
     * @param int $AccountNo
123
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetGroupRegularPricing
124
     */
125
    public function setAccountNo($AccountNo)
126
    {
127
        $this->AccountNo = $AccountNo;
128
        return $this;
129
    }
130
131
    /**
132
     * @return \DateTime
133
     */
134
    public function getDtArrivalDate()
135
    {
136
        if ($this->dtArrivalDate == null) {
137
            return null;
138
        } else {
139
            try {
140
                return new \DateTime($this->dtArrivalDate);
141
            } catch (\Exception $e) {
142
                return false;
143
            }
144
        }
145
    }
146
147
    /**
148
     * @param \DateTime $dtArrivalDate
149
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetGroupRegularPricing
150
     */
151
    public function setDtArrivalDate(\DateTime $dtArrivalDate)
152
    {
153
        $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...
154
        return $this;
155
    }
156
157
    /**
158
     * @return \DateTime
159
     */
160
    public function getDtDepartureDate()
161
    {
162
        if ($this->dtDepartureDate == null) {
163
            return null;
164
        } else {
165
            try {
166
                return new \DateTime($this->dtDepartureDate);
167
            } catch (\Exception $e) {
168
                return false;
169
            }
170
        }
171
    }
172
173
    /**
174
     * @param \DateTime $dtDepartureDate
175
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetGroupRegularPricing
176
     */
177
    public function setDtDepartureDate(\DateTime $dtDepartureDate)
178
    {
179
        $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...
180
        return $this;
181
    }
182
183
    /**
184
     * @return string
185
     */
186
    public function getStrRateCode()
187
    {
188
        return $this->strRateCode;
189
    }
190
191
    /**
192
     * @param string $strRateCode
193
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetGroupRegularPricing
194
     */
195
    public function setStrRateCode($strRateCode)
196
    {
197
        $this->strRateCode = $strRateCode;
198
        return $this;
199
    }
200
201
    /**
202
     * @return string
203
     */
204
    public function getStrListOfRoomTypes()
205
    {
206
        return $this->strListOfRoomTypes;
207
    }
208
209
    /**
210
     * @param string $strListOfRoomTypes
211
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetGroupRegularPricing
212
     */
213
    public function setStrListOfRoomTypes($strListOfRoomTypes)
214
    {
215
        $this->strListOfRoomTypes = $strListOfRoomTypes;
216
        return $this;
217
    }
218
219
    /**
220
     * @return TPriceType
221
     */
222
    public function getPriceType()
223
    {
224
        return $this->PriceType;
225
    }
226
227
    /**
228
     * @param TPriceType $PriceType
229
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetGroupRegularPricing
230
     */
231
    public function setPriceType($PriceType)
232
    {
233
        $this->PriceType = $PriceType;
234
        return $this;
235
    }
236
237
    /**
238
     * @return int
239
     */
240
    public function getAGuestCount()
241
    {
242
        return $this->aGuestCount;
243
    }
244
245
    /**
246
     * @param int $aGuestCount
247
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetGroupRegularPricing
248
     */
249
    public function setAGuestCount($aGuestCount)
250
    {
251
        $this->aGuestCount = $aGuestCount;
252
        return $this;
253
    }
254
}
255