cInfo::setDateOfBirth()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5
class cInfo
6
{
7
8
    /**
9
     * @var boolean $IsMarried
10
     */
11
    protected $IsMarried = null;
12
13
    /**
14
     * @var int $Sex
15
     */
16
    protected $Sex = null;
17
18
    /**
19
     * @var \DateTime $DateOfBirth
20
     */
21
    protected $DateOfBirth = null;
22
23
    /**
24
     * @var string $PassportID
25
     */
26
    protected $PassportID = null;
27
28
    /**
29
     * @var int $ID_Nationality
30
     */
31
    protected $ID_Nationality = null;
32
33
    /**
34
     * @var string $PassportIssuingLocation
35
     */
36
    protected $PassportIssuingLocation = null;
37
38
    /**
39
     * @var \DateTime $PassportExpireDate
40
     */
41
    protected $PassportExpireDate = null;
42
43
    /**
44
     * @param boolean $IsMarried
45
     * @param int $Sex
46
     * @param \DateTime $DateOfBirth
47
     * @param int $ID_Nationality
48
     * @param \DateTime $PassportExpireDate
49
     */
50 View Code Duplication
    public function __construct($IsMarried, $Sex, \DateTime $DateOfBirth, $ID_Nationality, \DateTime $PassportExpireDate)
0 ignored issues
show
Duplication introduced by
This method 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...
51
    {
52
        $this->IsMarried = $IsMarried;
53
        $this->Sex = $Sex;
54
        $this->DateOfBirth = $DateOfBirth->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $DateOfBirth->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $DateOfBirth.

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

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...
57
    }
58
59
    /**
60
     * @return boolean
61
     */
62
    public function getIsMarried()
63
    {
64
        return $this->IsMarried;
65
    }
66
67
    /**
68
     * @param boolean $IsMarried
69
     * @return \Gueststream\PMS\IQWare\API\cInfo
70
     */
71
    public function setIsMarried($IsMarried)
72
    {
73
        $this->IsMarried = $IsMarried;
74
        return $this;
75
    }
76
77
    /**
78
     * @return int
79
     */
80
    public function getSex()
81
    {
82
        return $this->Sex;
83
    }
84
85
    /**
86
     * @param int $Sex
87
     * @return \Gueststream\PMS\IQWare\API\cInfo
88
     */
89
    public function setSex($Sex)
90
    {
91
        $this->Sex = $Sex;
92
        return $this;
93
    }
94
95
    /**
96
     * @return \DateTime
97
     */
98
    public function getDateOfBirth()
99
    {
100
        if ($this->DateOfBirth == null) {
101
            return null;
102
        } else {
103
            try {
104
                return new \DateTime($this->DateOfBirth);
105
            } catch (\Exception $e) {
106
                return false;
107
            }
108
        }
109
    }
110
111
    /**
112
     * @param \DateTime $DateOfBirth
113
     * @return \Gueststream\PMS\IQWare\API\cInfo
114
     */
115
    public function setDateOfBirth(\DateTime $DateOfBirth)
116
    {
117
        $this->DateOfBirth = $DateOfBirth->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $DateOfBirth->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $DateOfBirth.

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...
118
        return $this;
119
    }
120
121
    /**
122
     * @return string
123
     */
124
    public function getPassportID()
125
    {
126
        return $this->PassportID;
127
    }
128
129
    /**
130
     * @param string $PassportID
131
     * @return \Gueststream\PMS\IQWare\API\cInfo
132
     */
133
    public function setPassportID($PassportID)
134
    {
135
        $this->PassportID = $PassportID;
136
        return $this;
137
    }
138
139
    /**
140
     * @return int
141
     */
142
    public function getID_Nationality()
143
    {
144
        return $this->ID_Nationality;
145
    }
146
147
    /**
148
     * @param int $ID_Nationality
149
     * @return \Gueststream\PMS\IQWare\API\cInfo
150
     */
151
    public function setID_Nationality($ID_Nationality)
152
    {
153
        $this->ID_Nationality = $ID_Nationality;
154
        return $this;
155
    }
156
157
    /**
158
     * @return string
159
     */
160
    public function getPassportIssuingLocation()
161
    {
162
        return $this->PassportIssuingLocation;
163
    }
164
165
    /**
166
     * @param string $PassportIssuingLocation
167
     * @return \Gueststream\PMS\IQWare\API\cInfo
168
     */
169
    public function setPassportIssuingLocation($PassportIssuingLocation)
170
    {
171
        $this->PassportIssuingLocation = $PassportIssuingLocation;
172
        return $this;
173
    }
174
175
    /**
176
     * @return \DateTime
177
     */
178
    public function getPassportExpireDate()
179
    {
180
        if ($this->PassportExpireDate == null) {
181
            return null;
182
        } else {
183
            try {
184
                return new \DateTime($this->PassportExpireDate);
185
            } catch (\Exception $e) {
186
                return false;
187
            }
188
        }
189
    }
190
191
    /**
192
     * @param \DateTime $PassportExpireDate
193
     * @return \Gueststream\PMS\IQWare\API\cInfo
194
     */
195
    public function setPassportExpireDate(\DateTime $PassportExpireDate)
196
    {
197
        $this->PassportExpireDate = $PassportExpireDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $PassportExpireDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $PassportExpireDate.

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...
198
        return $this;
199
    }
200
}
201