EvaluationThreaded   A
last analyzed

Complexity

Total Complexity 27

Size/Duplication

Total Lines 300
Duplicated Lines 100 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 27
lcom 2
cbo 0
dl 300
loc 300
ccs 0
cts 129
cp 0
rs 10
c 0
b 0
f 0

23 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 14 14 1
A getGuid() 4 4 1
A setGuid() 5 5 1
A getStrRateCodes() 4 4 1
A setStrRateCodes() 5 5 1
A getStrRoomTypes() 4 4 1
A setStrRoomTypes() 5 5 1
A getDtArrivalDate() 12 12 3
A setDtArrivalDate() 5 5 1
A getDtDepartureDate() 12 12 3
A setDtDepartureDate() 5 5 1
A getIntGuestCount() 4 4 1
A setIntGuestCount() 5 5 1
A getStrChildrens() 4 4 1
A setStrChildrens() 5 5 1
A getIntRateSpecial() 4 4 1
A setIntRateSpecial() 5 5 1
A getIntBuilding() 4 4 1
A setIntBuilding() 5 5 1
A getIntRoomQty() 4 4 1
A setIntRoomQty() 5 5 1
A getBackToBackMode() 4 4 1
A setBackToBackMode() 5 5 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5 View Code Duplication
class EvaluationThreaded
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
{
7
8
    /**
9
     * @var int $Guid
10
     */
11
    protected $Guid = null;
12
13
    /**
14
     * @var string $strRateCodes
15
     */
16
    protected $strRateCodes = null;
17
18
    /**
19
     * @var string $strRoomTypes
20
     */
21
    protected $strRoomTypes = 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 int $intGuestCount
35
     */
36
    protected $intGuestCount = null;
37
38
    /**
39
     * @var string $strChildrens
40
     */
41
    protected $strChildrens = null;
42
43
    /**
44
     * @var int $intRateSpecial
45
     */
46
    protected $intRateSpecial = null;
47
48
    /**
49
     * @var int $intBuilding
50
     */
51
    protected $intBuilding = null;
52
53
    /**
54
     * @var int $intRoomQty
55
     */
56
    protected $intRoomQty = null;
57
58
    /**
59
     * @var IAB2BMode $BackToBackMode
60
     */
61
    protected $BackToBackMode = null;
62
63
    /**
64
     * @param int $Guid
65
     * @param string $strRateCodes
66
     * @param string $strRoomTypes
67
     * @param \DateTime $dtArrivalDate
68
     * @param \DateTime $dtDepartureDate
69
     * @param int $intGuestCount
70
     * @param string $strChildrens
71
     * @param int $intRateSpecial
72
     * @param int $intBuilding
73
     * @param int $intRoomQty
74
     * @param IAB2BMode $BackToBackMode
75
     */
76
    public function __construct($Guid, $strRateCodes, $strRoomTypes, \DateTime $dtArrivalDate, \DateTime $dtDepartureDate, $intGuestCount, $strChildrens, $intRateSpecial, $intBuilding, $intRoomQty, $BackToBackMode)
77
    {
78
        $this->Guid = $Guid;
79
        $this->strRateCodes = $strRateCodes;
80
        $this->strRoomTypes = $strRoomTypes;
81
        $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...
82
        $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...
83
        $this->intGuestCount = $intGuestCount;
84
        $this->strChildrens = $strChildrens;
85
        $this->intRateSpecial = $intRateSpecial;
86
        $this->intBuilding = $intBuilding;
87
        $this->intRoomQty = $intRoomQty;
88
        $this->BackToBackMode = $BackToBackMode;
89
    }
90
91
    /**
92
     * @return int
93
     */
94
    public function getGuid()
95
    {
96
        return $this->Guid;
97
    }
98
99
    /**
100
     * @param int $Guid
101
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
102
     */
103
    public function setGuid($Guid)
104
    {
105
        $this->Guid = $Guid;
106
        return $this;
107
    }
108
109
    /**
110
     * @return string
111
     */
112
    public function getStrRateCodes()
113
    {
114
        return $this->strRateCodes;
115
    }
116
117
    /**
118
     * @param string $strRateCodes
119
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
120
     */
121
    public function setStrRateCodes($strRateCodes)
122
    {
123
        $this->strRateCodes = $strRateCodes;
124
        return $this;
125
    }
126
127
    /**
128
     * @return string
129
     */
130
    public function getStrRoomTypes()
131
    {
132
        return $this->strRoomTypes;
133
    }
134
135
    /**
136
     * @param string $strRoomTypes
137
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
138
     */
139
    public function setStrRoomTypes($strRoomTypes)
140
    {
141
        $this->strRoomTypes = $strRoomTypes;
142
        return $this;
143
    }
144
145
    /**
146
     * @return \DateTime
147
     */
148
    public function getDtArrivalDate()
149
    {
150
        if ($this->dtArrivalDate == null) {
151
            return null;
152
        } else {
153
            try {
154
                return new \DateTime($this->dtArrivalDate);
155
            } catch (\Exception $e) {
156
                return false;
157
            }
158
        }
159
    }
160
161
    /**
162
     * @param \DateTime $dtArrivalDate
163
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
164
     */
165
    public function setDtArrivalDate(\DateTime $dtArrivalDate)
166
    {
167
        $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...
168
        return $this;
169
    }
170
171
    /**
172
     * @return \DateTime
173
     */
174
    public function getDtDepartureDate()
175
    {
176
        if ($this->dtDepartureDate == null) {
177
            return null;
178
        } else {
179
            try {
180
                return new \DateTime($this->dtDepartureDate);
181
            } catch (\Exception $e) {
182
                return false;
183
            }
184
        }
185
    }
186
187
    /**
188
     * @param \DateTime $dtDepartureDate
189
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
190
     */
191
    public function setDtDepartureDate(\DateTime $dtDepartureDate)
192
    {
193
        $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...
194
        return $this;
195
    }
196
197
    /**
198
     * @return int
199
     */
200
    public function getIntGuestCount()
201
    {
202
        return $this->intGuestCount;
203
    }
204
205
    /**
206
     * @param int $intGuestCount
207
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
208
     */
209
    public function setIntGuestCount($intGuestCount)
210
    {
211
        $this->intGuestCount = $intGuestCount;
212
        return $this;
213
    }
214
215
    /**
216
     * @return string
217
     */
218
    public function getStrChildrens()
219
    {
220
        return $this->strChildrens;
221
    }
222
223
    /**
224
     * @param string $strChildrens
225
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
226
     */
227
    public function setStrChildrens($strChildrens)
228
    {
229
        $this->strChildrens = $strChildrens;
230
        return $this;
231
    }
232
233
    /**
234
     * @return int
235
     */
236
    public function getIntRateSpecial()
237
    {
238
        return $this->intRateSpecial;
239
    }
240
241
    /**
242
     * @param int $intRateSpecial
243
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
244
     */
245
    public function setIntRateSpecial($intRateSpecial)
246
    {
247
        $this->intRateSpecial = $intRateSpecial;
248
        return $this;
249
    }
250
251
    /**
252
     * @return int
253
     */
254
    public function getIntBuilding()
255
    {
256
        return $this->intBuilding;
257
    }
258
259
    /**
260
     * @param int $intBuilding
261
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
262
     */
263
    public function setIntBuilding($intBuilding)
264
    {
265
        $this->intBuilding = $intBuilding;
266
        return $this;
267
    }
268
269
    /**
270
     * @return int
271
     */
272
    public function getIntRoomQty()
273
    {
274
        return $this->intRoomQty;
275
    }
276
277
    /**
278
     * @param int $intRoomQty
279
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
280
     */
281
    public function setIntRoomQty($intRoomQty)
282
    {
283
        $this->intRoomQty = $intRoomQty;
284
        return $this;
285
    }
286
287
    /**
288
     * @return IAB2BMode
289
     */
290
    public function getBackToBackMode()
291
    {
292
        return $this->BackToBackMode;
293
    }
294
295
    /**
296
     * @param IAB2BMode $BackToBackMode
297
     * @return \Gueststream\PMS\IQWare\API\EvaluationThreaded
298
     */
299
    public function setBackToBackMode($BackToBackMode)
300
    {
301
        $this->BackToBackMode = $BackToBackMode;
302
        return $this;
303
    }
304
}
305