WebRes_GetOwnerRoomAvailability::getStartDate()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 8

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 12
loc 12
ccs 0
cts 12
cp 0
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 8
nc 3
nop 0
crap 12
1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5 View Code Duplication
class WebRes_GetOwnerRoomAvailability
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 $guid
10
     */
11
    protected $guid = null;
12
13
    /**
14
     * @var int $roomID
15
     */
16
    protected $roomID = null;
17
18
    /**
19
     * @var \DateTime $startDate
20
     */
21
    protected $startDate = null;
22
23
    /**
24
     * @var \DateTime $endDate
25
     */
26
    protected $endDate = null;
27
28
    /**
29
     * @var boolean $isSuite
30
     */
31
    protected $isSuite = null;
32
33
    /**
34
     * @param int $guid
35
     * @param int $roomID
36
     * @param \DateTime $startDate
37
     * @param \DateTime $endDate
38
     * @param boolean $isSuite
39
     */
40
    public function __construct($guid, $roomID, \DateTime $startDate, \DateTime $endDate, $isSuite)
41
    {
42
        $this->guid = $guid;
43
        $this->roomID = $roomID;
44
        $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...
45
        $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...
46
        $this->isSuite = $isSuite;
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\WebRes_GetOwnerRoomAvailability
60
     */
61
    public function setGuid($guid)
62
    {
63
        $this->guid = $guid;
64
        return $this;
65
    }
66
67
    /**
68
     * @return int
69
     */
70
    public function getRoomID()
71
    {
72
        return $this->roomID;
73
    }
74
75
    /**
76
     * @param int $roomID
77
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailability
78
     */
79
    public function setRoomID($roomID)
80
    {
81
        $this->roomID = $roomID;
82
        return $this;
83
    }
84
85
    /**
86
     * @return \DateTime
87
     */
88
    public function getStartDate()
89
    {
90
        if ($this->startDate == null) {
91
            return null;
92
        } else {
93
            try {
94
                return new \DateTime($this->startDate);
95
            } catch (\Exception $e) {
96
                return false;
97
            }
98
        }
99
    }
100
101
    /**
102
     * @param \DateTime $startDate
103
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailability
104
     */
105
    public function setStartDate(\DateTime $startDate)
106
    {
107
        $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...
108
        return $this;
109
    }
110
111
    /**
112
     * @return \DateTime
113
     */
114
    public function getEndDate()
115
    {
116
        if ($this->endDate == null) {
117
            return null;
118
        } else {
119
            try {
120
                return new \DateTime($this->endDate);
121
            } catch (\Exception $e) {
122
                return false;
123
            }
124
        }
125
    }
126
127
    /**
128
     * @param \DateTime $endDate
129
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailability
130
     */
131
    public function setEndDate(\DateTime $endDate)
132
    {
133
        $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...
134
        return $this;
135
    }
136
137
    /**
138
     * @return boolean
139
     */
140
    public function getIsSuite()
141
    {
142
        return $this->isSuite;
143
    }
144
145
    /**
146
     * @param boolean $isSuite
147
     * @return \Gueststream\PMS\IQWare\API\WebRes_GetOwnerRoomAvailability
148
     */
149
    public function setIsSuite($isSuite)
150
    {
151
        $this->isSuite = $isSuite;
152
        return $this;
153
    }
154
}
155