Passed
Push — master ( 77290b...f3fb78 )
by Marcel
09:09
created

UserRequest::getGrade()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace App\Request;
4
5
use App\Validator\ValidUserTypeUuid;
6
use DateTime;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9
class UserRequest {
10
11
    #[Assert\NotBlank]
12
    private string $username;
13
14
    #[Assert\NotBlank(allowNull: true)]
15
    private ?string $password = null;
16
17
    private ?string $externalId = null;
18
19
    #[Assert\NotBlank]
20
    private string $firstname;
21
22
    #[Assert\NotBlank]
23
    #[Assert\Email]
24
    private string $email;
25
26
    #[Assert\NotBlank]
27
    private string $lastname;
28
29
    private ?string $grade = null;
30
31
    /**
32
     * @ValidUserTypeUuid()
33
     */
34
    #[Assert\NotBlank]
35
    #[Assert\Uuid]
36
    private string $type;
37
38
    private bool $isActive = true;
39
40
    private ?DateTime $enabledFrom = null;
41
42
    private ?DateTime $enabledUntil = null;
43
44
    /**
45
     * @return string
46
     */
47
    public function getUsername(): string {
48
        return $this->username;
49
    }
50
51
    public function getPassword(): ?string {
52
        return $this->password;
53
    }
54
55
    public function getExternalId(): ?string {
56
        return $this->externalId;
57
    }
58
59
    /**
60
     * @return string
61
     */
62
    public function getFirstname(): string {
63
        return $this->firstname;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getEmail(): string {
70
        return $this->email;
71
    }
72
73
    /**
74
     * @return string
75
     */
76
    public function getLastname(): string {
77
        return $this->lastname;
78
    }
79
80
    public function getGrade(): ?string {
81
        return $this->grade;
82
    }
83
84
    /**
85
     * @return string
86
     */
87
    public function getType(): string {
88
        return $this->type;
89
    }
90
91
    public function isActive(): bool {
92
        return $this->isActive;
93
    }
94
95
    public function getEnabledFrom(): ?DateTime {
96
        return $this->enabledFrom;
97
    }
98
99
    public function getEnabledUntil(): ?DateTime {
100
        return $this->enabledUntil;
101
    }
102
103
    /**
104
     * @param string $username
105
     */
106
    public function setUsername(string $username): void {
107
        $this->username = $username;
108
    }
109
110
    /**
111
     * @param string|null $password
112
     */
113
    public function setPassword(?string $password): void {
114
        $this->password = $password;
115
    }
116
117
    /**
118
     * @param string|null $externalId
119
     */
120
    public function setExternalId(?string $externalId): void {
121
        $this->externalId = $externalId;
122
    }
123
124
    /**
125
     * @param string $firstname
126
     */
127
    public function setFirstname(string $firstname): void {
128
        $this->firstname = $firstname;
129
    }
130
131
    /**
132
     * @param string $email
133
     */
134
    public function setEmail(string $email): void {
135
        $this->email = $email;
136
    }
137
138
    /**
139
     * @param string $lastname
140
     */
141
    public function setLastname(string $lastname): void {
142
        $this->lastname = $lastname;
143
    }
144
145
    /**
146
     * @param string|null $grade
147
     */
148
    public function setGrade(?string $grade): void {
149
        $this->grade = $grade;
150
    }
151
152
    /**
153
     * @param string $type
154
     */
155
    public function setType(string $type): void {
156
        $this->type = $type;
157
    }
158
159
    /**
160
     * @param bool $isActive
161
     */
162
    public function setIsActive(bool $isActive): void {
163
        $this->isActive = $isActive;
164
    }
165
166
    /**
167
     * @param DateTime|null $enabledFrom
168
     */
169
    public function setEnabledFrom(?DateTime $enabledFrom): void {
170
        $this->enabledFrom = $enabledFrom;
171
    }
172
173
    /**
174
     * @param DateTime|null $enabledUntil
175
     */
176
    public function setEnabledUntil(?DateTime $enabledUntil): void {
177
        $this->enabledUntil = $enabledUntil;
178
    }
179
}