__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 WebRes_GetOwnerRoomAvailabilityByAdminID
6
{
7
8
    /**
9
     * @var int $guid
10
     */
11
    protected $guid = null;
12
13
    /**
14
     * @var int $ID_CondoOwner
15
     */
16
    protected $ID_CondoOwner = null;
17
18
    /**
19
     * @var int $AdminID
20
     */
21
    protected $AdminID = null;
22
23
    /**
24
     * @var int $MemberID
25
     */
26
    protected $MemberID = null;
27
28
    /**
29
     * @var int $ID_RateCode
30
     */
31
    protected $ID_RateCode = null;
32
33
    /**
34
     * @var \DateTime $startDate
35
     */
36
    protected $startDate = null;
37
38
    /**
39
     * @var \DateTime $endDate
40
     */
41
    protected $endDate = null;
42
43
    /**
44
     * @var boolean $ValidateResa
45
     */
46
    protected $ValidateResa = null;
47
48
    /**
49
     * @param int $guid
50
     * @param int $ID_CondoOwner
51
     * @param int $AdminID
52
     * @param int $MemberID
53
     * @param int $ID_RateCode
54
     * @param \DateTime $startDate
55
     * @param \DateTime $endDate
56
     * @param boolean $ValidateResa
57
     */
58
    public function __construct($guid, $ID_CondoOwner, $AdminID, $MemberID, $ID_RateCode, \DateTime $startDate, \DateTime $endDate, $ValidateResa)
59
    {
60
        $this->guid = $guid;
61
        $this->ID_CondoOwner = $ID_CondoOwner;
62
        $this->AdminID = $AdminID;
63
        $this->MemberID = $MemberID;
64
        $this->ID_RateCode = $ID_RateCode;
65
        $this->startDate = $startDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $startDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $startDate.

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

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...
67
        $this->ValidateResa = $ValidateResa;
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\WebRes_GetOwnerRoomAvailabilityByAdminID
81
     */
82
    public function setGuid($guid)
83
    {
84
        $this->guid = $guid;
85
        return $this;
86
    }
87
88
    /**
89
     * @return int
90
     */
91
    public function getID_CondoOwner()
92
    {
93
        return $this->ID_CondoOwner;
94
    }
95
96
    /**
97
     * @param int $ID_CondoOwner
98
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailabilityByAdminID
99
     */
100
    public function setID_CondoOwner($ID_CondoOwner)
101
    {
102
        $this->ID_CondoOwner = $ID_CondoOwner;
103
        return $this;
104
    }
105
106
    /**
107
     * @return int
108
     */
109
    public function getAdminID()
110
    {
111
        return $this->AdminID;
112
    }
113
114
    /**
115
     * @param int $AdminID
116
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailabilityByAdminID
117
     */
118
    public function setAdminID($AdminID)
119
    {
120
        $this->AdminID = $AdminID;
121
        return $this;
122
    }
123
124
    /**
125
     * @return int
126
     */
127
    public function getMemberID()
128
    {
129
        return $this->MemberID;
130
    }
131
132
    /**
133
     * @param int $MemberID
134
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailabilityByAdminID
135
     */
136
    public function setMemberID($MemberID)
137
    {
138
        $this->MemberID = $MemberID;
139
        return $this;
140
    }
141
142
    /**
143
     * @return int
144
     */
145
    public function getID_RateCode()
146
    {
147
        return $this->ID_RateCode;
148
    }
149
150
    /**
151
     * @param int $ID_RateCode
152
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailabilityByAdminID
153
     */
154
    public function setID_RateCode($ID_RateCode)
155
    {
156
        $this->ID_RateCode = $ID_RateCode;
157
        return $this;
158
    }
159
160
    /**
161
     * @return \DateTime
162
     */
163
    public function getStartDate()
164
    {
165
        if ($this->startDate == null) {
166
            return null;
167
        } else {
168
            try {
169
                return new \DateTime($this->startDate);
170
            } catch (\Exception $e) {
171
                return false;
172
            }
173
        }
174
    }
175
176
    /**
177
     * @param \DateTime $startDate
178
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailabilityByAdminID
179
     */
180
    public function setStartDate(\DateTime $startDate)
181
    {
182
        $this->startDate = $startDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $startDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $startDate.

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 \DateTime
188
     */
189
    public function getEndDate()
190
    {
191
        if ($this->endDate == null) {
192
            return null;
193
        } else {
194
            try {
195
                return new \DateTime($this->endDate);
196
            } catch (\Exception $e) {
197
                return false;
198
            }
199
        }
200
    }
201
202
    /**
203
     * @param \DateTime $endDate
204
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailabilityByAdminID
205
     */
206
    public function setEndDate(\DateTime $endDate)
207
    {
208
        $this->endDate = $endDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $endDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $endDate.

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...
209
        return $this;
210
    }
211
212
    /**
213
     * @return boolean
214
     */
215
    public function getValidateResa()
216
    {
217
        return $this->ValidateResa;
218
    }
219
220
    /**
221
     * @param boolean $ValidateResa
222
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailabilityByAdminID
223
     */
224
    public function setValidateResa($ValidateResa)
225
    {
226
        $this->ValidateResa = $ValidateResa;
227
        return $this;
228
    }
229
}
230