User::isValid()   A
last analyzed

Complexity

Conditions 4
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 4
nc 2
nop 0
1
<?php
2
3
namespace Skobkin\Bundle\PointToolsBundle\DTO\Api;
4
5
class User implements ValidableInterface
6
{
7
    /**
8
     * @var string|null
9
     */
10
    private $id;
11
12
    /**
13
     * @var string|null
14
     */
15
    private $login;
16
17
    /**
18
     * @var string|null
19
     */
20
    private $name;
21
22
    /**
23
     * @var string|null
24
     */
25
    private $about;
26
27
    /**
28
     * @var string|null
29
     */
30
    private $xmpp;
31
32
    /**
33
     * @var string|null
34
     */
35
    private $created;
36
37
    /**
38
     * @var bool|null
39
     */
40
    private $gender;
41
42
    /**
43
     * @var bool|null
44
     */
45
    private $denyAnonymous;
46
47
    /**
48
     * @var bool|null
49
     */
50
    private $private;
51
52
    /**
53
     * @var string|null
54
     */
55
    private $birthDate;
56
57
    /**
58
     * @var string|null
59
     */
60
    private $homepage;
61
62
    /**
63
     * @var string|null
64
     */
65
    private $email;
66
67
    /**
68
     * @var string|null
69
     */
70
    private $location;
71
72
    /**
73
     * @var string|null
74
     */
75
    private $error;
76
77
78
    public function getId(): ?string
79
    {
80
        return $this->id;
81
    }
82
83
    public function setId(?string $id): void
84
    {
85
        $this->id = $id;
86
    }
87
88
    public function getLogin(): ?string
89
    {
90
        return $this->login;
91
    }
92
93
    public function setLogin(?string $login): void
94
    {
95
        $this->login = $login;
96
    }
97
98
    public function getName(): ?string
99
    {
100
        return $this->name;
101
    }
102
    
103
    public function setName(?string $name): void
104
    {
105
        $this->name = $name;
106
    }
107
108
    public function getAbout(): ?string
109
    {
110
        return $this->about;
111
    }
112
113
    public function setAbout(?string $about): void
114
    {
115
        $this->about = $about;
116
    }
117
118
    public function getXmpp(): ?string
119
    {
120
        return $this->xmpp;
121
    }
122
123
    public function setXmpp(?string $xmpp): void
124
    {
125
        $this->xmpp = $xmpp;
126
    }
127
128
    public function getCreated(): ?string
129
    {
130
        return $this->created;
131
    }
132
133
    public function setCreated(?string $created): void
134
    {
135
        $this->created = $created;
136
    }
137
138
    public function getGender(): ?bool
139
    {
140
        return $this->gender;
141
    }
142
143
    public function setGender(?bool $gender): void
144
    {
145
        $this->gender = $gender;
146
    }
147
148
    public function getDenyAnonymous(): ?bool
149
    {
150
        return $this->denyAnonymous;
151
    }
152
153
    public function setDenyAnonymous(?bool $denyAnonymous): void
154
    {
155
        $this->denyAnonymous = $denyAnonymous;
156
    }
157
158
    public function getPrivate(): ?bool
159
    {
160
        return $this->private;
161
    }
162
163
    public function setPrivate(?bool $private): void
164
    {
165
        $this->private = $private;
166
    }
167
168
    public function getBirthDate(): ?string
169
    {
170
        return $this->birthDate;
171
    }
172
173
    public function setBirthDate(?string $birthDate): void
174
    {
175
        $this->birthDate = $birthDate;
176
    }
177
178
    public function getHomepage(): ?string
179
    {
180
        return $this->homepage;
181
    }
182
183
    public function setHomepage(?string $homepage): void
184
    {
185
        $this->homepage = $homepage;
186
    }
187
188
    public function getEmail(): ?string
189
    {
190
        return $this->email;
191
    }
192
193
    public function setEmail(?string $email): void
194
    {
195
        $this->email = $email;
196
    }
197
198
    public function getLocation(): ?string
199
    {
200
        return $this->location;
201
    }
202
203
    public function setLocation(?string $location): void
204
    {
205
        $this->location = $location;
206
    }
207
208
    public function getError(): ?string
209
    {
210
        return $this->error;
211
    }
212
213
    public function setError(?string $error): void
214
    {
215
        $this->error = $error;
216
    }
217
218
    public function isValid(): bool
219
    {
220
        if (null === $this->error && null !== $this->id && null !== $this->login) {
221
            return true;
222
        }
223
224
        return false;
225
    }
226
}