WebRes_GetHotelAvailabilityArray::setEnd()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 5
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5 View Code Duplication
class WebRes_GetHotelAvailabilityArray
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 string $lstOfRoomTypeIDs
10
     */
11
    protected $lstOfRoomTypeIDs = null;
12
13
    /**
14
     * @var int $intGUID
15
     */
16
    protected $intGUID = null;
17
18
    /**
19
     * @var \DateTime $start
20
     */
21
    protected $start = null;
22
23
    /**
24
     * @var \DateTime $end
25
     */
26
    protected $end = null;
27
28
    /**
29
     * @var boolean $isSuite
30
     */
31
    protected $isSuite = null;
32
33
    /**
34
     * @var string $strISOLanguageCode
35
     */
36
    protected $strISOLanguageCode = null;
37
38
    /**
39
     * @param string $lstOfRoomTypeIDs
40
     * @param int $intGUID
41
     * @param \DateTime $start
42
     * @param \DateTime $end
43
     * @param boolean $isSuite
44
     * @param string $strISOLanguageCode
45
     */
46
    public function __construct($lstOfRoomTypeIDs, $intGUID, \DateTime $start, \DateTime $end, $isSuite, $strISOLanguageCode)
47
    {
48
        $this->lstOfRoomTypeIDs = $lstOfRoomTypeIDs;
49
        $this->intGUID = $intGUID;
50
        $this->start = $start->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $start->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $start.

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

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...
52
        $this->isSuite = $isSuite;
53
        $this->strISOLanguageCode = $strISOLanguageCode;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getLstOfRoomTypeIDs()
60
    {
61
        return $this->lstOfRoomTypeIDs;
62
    }
63
64
    /**
65
     * @param string $lstOfRoomTypeIDs
66
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetHotelAvailabilityArray
67
     */
68
    public function setLstOfRoomTypeIDs($lstOfRoomTypeIDs)
69
    {
70
        $this->lstOfRoomTypeIDs = $lstOfRoomTypeIDs;
71
        return $this;
72
    }
73
74
    /**
75
     * @return int
76
     */
77
    public function getIntGUID()
78
    {
79
        return $this->intGUID;
80
    }
81
82
    /**
83
     * @param int $intGUID
84
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetHotelAvailabilityArray
85
     */
86
    public function setIntGUID($intGUID)
87
    {
88
        $this->intGUID = $intGUID;
89
        return $this;
90
    }
91
92
    /**
93
     * @return \DateTime
94
     */
95
    public function getStart()
96
    {
97
        if ($this->start == null) {
98
            return null;
99
        } else {
100
            try {
101
                return new \DateTime($this->start);
102
            } catch (\Exception $e) {
103
                return false;
104
            }
105
        }
106
    }
107
108
    /**
109
     * @param \DateTime $start
110
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetHotelAvailabilityArray
111
     */
112
    public function setStart(\DateTime $start)
113
    {
114
        $this->start = $start->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $start->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $start.

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...
115
        return $this;
116
    }
117
118
    /**
119
     * @return \DateTime
120
     */
121
    public function getEnd()
122
    {
123
        if ($this->end == null) {
124
            return null;
125
        } else {
126
            try {
127
                return new \DateTime($this->end);
128
            } catch (\Exception $e) {
129
                return false;
130
            }
131
        }
132
    }
133
134
    /**
135
     * @param \DateTime $end
136
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetHotelAvailabilityArray
137
     */
138
    public function setEnd(\DateTime $end)
139
    {
140
        $this->end = $end->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $end->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $end.

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...
141
        return $this;
142
    }
143
144
    /**
145
     * @return boolean
146
     */
147
    public function getIsSuite()
148
    {
149
        return $this->isSuite;
150
    }
151
152
    /**
153
     * @param boolean $isSuite
154
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetHotelAvailabilityArray
155
     */
156
    public function setIsSuite($isSuite)
157
    {
158
        $this->isSuite = $isSuite;
159
        return $this;
160
    }
161
162
    /**
163
     * @return string
164
     */
165
    public function getStrISOLanguageCode()
166
    {
167
        return $this->strISOLanguageCode;
168
    }
169
170
    /**
171
     * @param string $strISOLanguageCode
172
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetHotelAvailabilityArray
173
     */
174
    public function setStrISOLanguageCode($strISOLanguageCode)
175
    {
176
        $this->strISOLanguageCode = $strISOLanguageCode;
177
        return $this;
178
    }
179
}
180