GetSeasonalArrivalAndDepartureTime::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 2
1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5
class GetSeasonalArrivalAndDepartureTime
6
{
7
8
    /**
9
     * @var int $intGUID
10
     */
11
    protected $intGUID = null;
12
13
    /**
14
     * @var \DateTime $ArrivalDate
15
     */
16
    protected $ArrivalDate = null;
17
18
    /**
19
     * @var \DateTime $DepartureDate
20
     */
21
    protected $DepartureDate = null;
22
23
    /**
24
     * @param int $intGUID
25
     * @param \DateTime $ArrivalDate
26
     * @param \DateTime $DepartureDate
27
     */
28
    public function __construct($intGUID, \DateTime $ArrivalDate, \DateTime $DepartureDate)
29
    {
30
        $this->intGUID = $intGUID;
31
        $this->ArrivalDate = $ArrivalDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ArrivalDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ArrivalDate.

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

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...
33
    }
34
35
    /**
36
     * @return int
37
     */
38
    public function getIntGUID()
39
    {
40
        return $this->intGUID;
41
    }
42
43
    /**
44
     * @param int $intGUID
45
     * @return \Gueststream\PMS\IQWare\API\GetSeasonalArrivalAndDepartureTime
46
     */
47
    public function setIntGUID($intGUID)
48
    {
49
        $this->intGUID = $intGUID;
50
        return $this;
51
    }
52
53
    /**
54
     * @return \DateTime
55
     */
56
    public function getArrivalDate()
57
    {
58
        if ($this->ArrivalDate == null) {
59
            return null;
60
        } else {
61
            try {
62
                return new \DateTime($this->ArrivalDate);
63
            } catch (\Exception $e) {
64
                return false;
65
            }
66
        }
67
    }
68
69
    /**
70
     * @param \DateTime $ArrivalDate
71
     * @return \Gueststream\PMS\IQWare\API\GetSeasonalArrivalAndDepartureTime
72
     */
73
    public function setArrivalDate(\DateTime $ArrivalDate)
74
    {
75
        $this->ArrivalDate = $ArrivalDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ArrivalDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ArrivalDate.

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...
76
        return $this;
77
    }
78
79
    /**
80
     * @return \DateTime
81
     */
82
    public function getDepartureDate()
83
    {
84
        if ($this->DepartureDate == null) {
85
            return null;
86
        } else {
87
            try {
88
                return new \DateTime($this->DepartureDate);
89
            } catch (\Exception $e) {
90
                return false;
91
            }
92
        }
93
    }
94
95
    /**
96
     * @param \DateTime $DepartureDate
97
     * @return \Gueststream\PMS\IQWare\API\GetSeasonalArrivalAndDepartureTime
98
     */
99
    public function setDepartureDate(\DateTime $DepartureDate)
100
    {
101
        $this->DepartureDate = $DepartureDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $DepartureDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $DepartureDate.

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...
102
        return $this;
103
    }
104
}
105