GetAllCancellationNew::__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 GetAllCancellationNew
6
{
7
8
    /**
9
     * @var int $GUID
10
     */
11
    protected $GUID = null;
12
13
    /**
14
     * @var \DateTime $FromDate
15
     */
16
    protected $FromDate = null;
17
18
    /**
19
     * @var \DateTime $ToDate
20
     */
21
    protected $ToDate = null;
22
23
    /**
24
     * @param int $GUID
25
     * @param \DateTime $FromDate
26
     * @param \DateTime $ToDate
27
     */
28
    public function __construct($GUID, \DateTime $FromDate, \DateTime $ToDate)
29
    {
30
        $this->GUID = $GUID;
31
        $this->FromDate = $FromDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $FromDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $FromDate.

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

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

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

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