WSCRS_GetNewAvailability   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 100
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 11
lcom 2
cbo 0
dl 0
loc 100
ccs 0
cts 49
cp 0
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getStartDate() 0 12 3
A setStartDate() 0 5 1
A getEndDate() 0 12 3
A setEndDate() 0 5 1
A getIsSuite() 0 4 1
A setIsSuite() 0 5 1
1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5
class WSCRS_GetNewAvailability
6
{
7
8
    /**
9
     * @var \DateTime $StartDate
10
     */
11
    protected $StartDate = null;
12
13
    /**
14
     * @var \DateTime $EndDate
15
     */
16
    protected $EndDate = null;
17
18
    /**
19
     * @var boolean $IsSuite
20
     */
21
    protected $IsSuite = null;
22
23
    /**
24
     * @param \DateTime $StartDate
25
     * @param \DateTime $EndDate
26
     * @param boolean $IsSuite
27
     */
28
    public function __construct(\DateTime $StartDate, \DateTime $EndDate, $IsSuite)
29
    {
30
        $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...
31
        $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...
32
        $this->IsSuite = $IsSuite;
33
    }
34
35
    /**
36
     * @return \DateTime
37
     */
38
    public function getStartDate()
39
    {
40
        if ($this->StartDate == null) {
41
            return null;
42
        } else {
43
            try {
44
                return new \DateTime($this->StartDate);
45
            } catch (\Exception $e) {
46
                return false;
47
            }
48
        }
49
    }
50
51
    /**
52
     * @param \DateTime $StartDate
53
     * @return \Gueststream\PMS\IQWare\API\WSCRS_GetNewAvailability
54
     */
55
    public function setStartDate(\DateTime $StartDate)
56
    {
57
        $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...
58
        return $this;
59
    }
60
61
    /**
62
     * @return \DateTime
63
     */
64
    public function getEndDate()
65
    {
66
        if ($this->EndDate == null) {
67
            return null;
68
        } else {
69
            try {
70
                return new \DateTime($this->EndDate);
71
            } catch (\Exception $e) {
72
                return false;
73
            }
74
        }
75
    }
76
77
    /**
78
     * @param \DateTime $EndDate
79
     * @return \Gueststream\PMS\IQWare\API\WSCRS_GetNewAvailability
80
     */
81
    public function setEndDate(\DateTime $EndDate)
82
    {
83
        $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...
84
        return $this;
85
    }
86
87
    /**
88
     * @return boolean
89
     */
90
    public function getIsSuite()
91
    {
92
        return $this->IsSuite;
93
    }
94
95
    /**
96
     * @param boolean $IsSuite
97
     * @return \Gueststream\PMS\IQWare\API\WSCRS_GetNewAvailability
98
     */
99
    public function setIsSuite($IsSuite)
100
    {
101
        $this->IsSuite = $IsSuite;
102
        return $this;
103
    }
104
}
105