Evaluate::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 11
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 8
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 Evaluate
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 $Arrival
25
     */
26
    protected $Arrival = null;
27
28
    /**
29
     * @var \DateTime $Departure
30
     */
31
    protected $Departure = null;
32
33
    /**
34
     * @var int $GuestCount
35
     */
36
    protected $GuestCount = null;
37
38
    /**
39
     * @var string $ChildAges
40
     */
41
    protected $ChildAges = null;
42
43
    /**
44
     * @var int $ID_RateSpecial
45
     */
46
    protected $ID_RateSpecial = null;
47
48
    /**
49
     * @param int $Guid
50
     * @param string $strRateCodes
51
     * @param string $strRoomTypes
52
     * @param \DateTime $Arrival
53
     * @param \DateTime $Departure
54
     * @param int $GuestCount
55
     * @param string $ChildAges
56
     * @param int $ID_RateSpecial
57
     */
58
    public function __construct($Guid, $strRateCodes, $strRoomTypes, \DateTime $Arrival, \DateTime $Departure, $GuestCount, $ChildAges, $ID_RateSpecial)
59
    {
60
        $this->Guid = $Guid;
61
        $this->strRateCodes = $strRateCodes;
62
        $this->strRoomTypes = $strRoomTypes;
63
        $this->Arrival = $Arrival->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $Arrival->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $Arrival.

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

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...
65
        $this->GuestCount = $GuestCount;
66
        $this->ChildAges = $ChildAges;
67
        $this->ID_RateSpecial = $ID_RateSpecial;
68
    }
69
70
    /**
71
     * @return int
72
     */
73
    public function getGuid()
74
    {
75
        return $this->Guid;
76
    }
77
78
    /**
79
     * @param int $Guid
80
     * @return \Gueststream\PMS\IQWare\API\Evaluate
81
     */
82
    public function setGuid($Guid)
83
    {
84
        $this->Guid = $Guid;
85
        return $this;
86
    }
87
88
    /**
89
     * @return string
90
     */
91
    public function getStrRateCodes()
92
    {
93
        return $this->strRateCodes;
94
    }
95
96
    /**
97
     * @param string $strRateCodes
98
     * @return \Gueststream\PMS\IQWare\API\Evaluate
99
     */
100
    public function setStrRateCodes($strRateCodes)
101
    {
102
        $this->strRateCodes = $strRateCodes;
103
        return $this;
104
    }
105
106
    /**
107
     * @return string
108
     */
109
    public function getStrRoomTypes()
110
    {
111
        return $this->strRoomTypes;
112
    }
113
114
    /**
115
     * @param string $strRoomTypes
116
     * @return \Gueststream\PMS\IQWare\API\Evaluate
117
     */
118
    public function setStrRoomTypes($strRoomTypes)
119
    {
120
        $this->strRoomTypes = $strRoomTypes;
121
        return $this;
122
    }
123
124
    /**
125
     * @return \DateTime
126
     */
127
    public function getArrival()
128
    {
129
        if ($this->Arrival == null) {
130
            return null;
131
        } else {
132
            try {
133
                return new \DateTime($this->Arrival);
134
            } catch (\Exception $e) {
135
                return false;
136
            }
137
        }
138
    }
139
140
    /**
141
     * @param \DateTime $Arrival
142
     * @return \Gueststream\PMS\IQWare\API\Evaluate
143
     */
144
    public function setArrival(\DateTime $Arrival)
145
    {
146
        $this->Arrival = $Arrival->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $Arrival->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $Arrival.

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...
147
        return $this;
148
    }
149
150
    /**
151
     * @return \DateTime
152
     */
153
    public function getDeparture()
154
    {
155
        if ($this->Departure == null) {
156
            return null;
157
        } else {
158
            try {
159
                return new \DateTime($this->Departure);
160
            } catch (\Exception $e) {
161
                return false;
162
            }
163
        }
164
    }
165
166
    /**
167
     * @param \DateTime $Departure
168
     * @return \Gueststream\PMS\IQWare\API\Evaluate
169
     */
170
    public function setDeparture(\DateTime $Departure)
171
    {
172
        $this->Departure = $Departure->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $Departure->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $Departure.

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...
173
        return $this;
174
    }
175
176
    /**
177
     * @return int
178
     */
179
    public function getGuestCount()
180
    {
181
        return $this->GuestCount;
182
    }
183
184
    /**
185
     * @param int $GuestCount
186
     * @return \Gueststream\PMS\IQWare\API\Evaluate
187
     */
188
    public function setGuestCount($GuestCount)
189
    {
190
        $this->GuestCount = $GuestCount;
191
        return $this;
192
    }
193
194
    /**
195
     * @return string
196
     */
197
    public function getChildAges()
198
    {
199
        return $this->ChildAges;
200
    }
201
202
    /**
203
     * @param string $ChildAges
204
     * @return \Gueststream\PMS\IQWare\API\Evaluate
205
     */
206
    public function setChildAges($ChildAges)
207
    {
208
        $this->ChildAges = $ChildAges;
209
        return $this;
210
    }
211
212
    /**
213
     * @return int
214
     */
215
    public function getID_RateSpecial()
216
    {
217
        return $this->ID_RateSpecial;
218
    }
219
220
    /**
221
     * @param int $ID_RateSpecial
222
     * @return \Gueststream\PMS\IQWare\API\Evaluate
223
     */
224
    public function setID_RateSpecial($ID_RateSpecial)
225
    {
226
        $this->ID_RateSpecial = $ID_RateSpecial;
227
        return $this;
228
    }
229
}
230