GDS_GetRates   A
last analyzed

Complexity

Total Complexity 15

Size/Duplication

Total Lines 150
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 15
lcom 2
cbo 0
dl 0
loc 150
ccs 0
cts 69
cp 0
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getGuid() 0 4 1
A setGuid() 0 5 1
A getStart() 0 12 3
A setStart() 0 5 1
A getEnd() 0 12 3
A setEnd() 0 5 1
A getStrRateCodeIDs() 0 4 1
A setStrRateCodeIDs() 0 5 1
A getStrRoomTypeIDs() 0 4 1
A setStrRoomTypeIDs() 0 5 1
1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5
class GDS_GetRates
6
{
7
8
    /**
9
     * @var int $guid
10
     */
11
    protected $guid = null;
12
13
    /**
14
     * @var \DateTime $start
15
     */
16
    protected $start = null;
17
18
    /**
19
     * @var \DateTime $end
20
     */
21
    protected $end = null;
22
23
    /**
24
     * @var string $strRateCodeIDs
25
     */
26
    protected $strRateCodeIDs = null;
27
28
    /**
29
     * @var string $strRoomTypeIDs
30
     */
31
    protected $strRoomTypeIDs = null;
32
33
    /**
34
     * @param int $guid
35
     * @param \DateTime $start
36
     * @param \DateTime $end
37
     * @param string $strRateCodeIDs
38
     * @param string $strRoomTypeIDs
39
     */
40
    public function __construct($guid, \DateTime $start, \DateTime $end, $strRateCodeIDs, $strRoomTypeIDs)
41
    {
42
        $this->guid = $guid;
43
        $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...
44
        $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...
45
        $this->strRateCodeIDs = $strRateCodeIDs;
46
        $this->strRoomTypeIDs = $strRoomTypeIDs;
47
    }
48
49
    /**
50
     * @return int
51
     */
52
    public function getGuid()
53
    {
54
        return $this->guid;
55
    }
56
57
    /**
58
     * @param int $guid
59
     * @return \Gueststream\PMS\IQWare\API\GDS_GetRates
60
     */
61
    public function setGuid($guid)
62
    {
63
        $this->guid = $guid;
64
        return $this;
65
    }
66
67
    /**
68
     * @return \DateTime
69
     */
70
    public function getStart()
71
    {
72
        if ($this->start == null) {
73
            return null;
74
        } else {
75
            try {
76
                return new \DateTime($this->start);
77
            } catch (\Exception $e) {
78
                return false;
79
            }
80
        }
81
    }
82
83
    /**
84
     * @param \DateTime $start
85
     * @return \Gueststream\PMS\IQWare\API\GDS_GetRates
86
     */
87
    public function setStart(\DateTime $start)
88
    {
89
        $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...
90
        return $this;
91
    }
92
93
    /**
94
     * @return \DateTime
95
     */
96
    public function getEnd()
97
    {
98
        if ($this->end == null) {
99
            return null;
100
        } else {
101
            try {
102
                return new \DateTime($this->end);
103
            } catch (\Exception $e) {
104
                return false;
105
            }
106
        }
107
    }
108
109
    /**
110
     * @param \DateTime $end
111
     * @return \Gueststream\PMS\IQWare\API\GDS_GetRates
112
     */
113
    public function setEnd(\DateTime $end)
114
    {
115
        $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...
116
        return $this;
117
    }
118
119
    /**
120
     * @return string
121
     */
122
    public function getStrRateCodeIDs()
123
    {
124
        return $this->strRateCodeIDs;
125
    }
126
127
    /**
128
     * @param string $strRateCodeIDs
129
     * @return \Gueststream\PMS\IQWare\API\GDS_GetRates
130
     */
131
    public function setStrRateCodeIDs($strRateCodeIDs)
132
    {
133
        $this->strRateCodeIDs = $strRateCodeIDs;
134
        return $this;
135
    }
136
137
    /**
138
     * @return string
139
     */
140
    public function getStrRoomTypeIDs()
141
    {
142
        return $this->strRoomTypeIDs;
143
    }
144
145
    /**
146
     * @param string $strRoomTypeIDs
147
     * @return \Gueststream\PMS\IQWare\API\GDS_GetRates
148
     */
149
    public function setStrRoomTypeIDs($strRoomTypeIDs)
150
    {
151
        $this->strRoomTypeIDs = $strRoomTypeIDs;
152
        return $this;
153
    }
154
}
155