GDS_GetRestrictions::getStrRateCodeIDs()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5 View Code Duplication
class GDS_GetRestrictions
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 $intGUID
10
     */
11
    protected $intGUID = 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 $intGUID
35
     * @param \DateTime $start
36
     * @param \DateTime $end
37
     * @param string $strRateCodeIDs
38
     * @param string $strRoomTypeIDs
39
     */
40
    public function __construct($intGUID, \DateTime $start, \DateTime $end, $strRateCodeIDs, $strRoomTypeIDs)
41
    {
42
        $this->intGUID = $intGUID;
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 getIntGUID()
53
    {
54
        return $this->intGUID;
55
    }
56
57
    /**
58
     * @param int $intGUID
59
     * @return \Gueststream\PMS\IQWare\API\GDS_GetRestrictions
60
     */
61
    public function setIntGUID($intGUID)
62
    {
63
        $this->intGUID = $intGUID;
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_GetRestrictions
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_GetRestrictions
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_GetRestrictions
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_GetRestrictions
148
     */
149
    public function setStrRoomTypeIDs($strRoomTypeIDs)
150
    {
151
        $this->strRoomTypeIDs = $strRoomTypeIDs;
152
        return $this;
153
    }
154
}
155