Passed
Push — develop ( 370f48...cc396d )
by Laurent
07:33 queued 04:53
created

User   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 45
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A email() 0 3 1
A uuid() 0 3 1
A roles() 0 3 1
A username() 0 3 1
A password() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the G.L.S.R. Apps package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Administration\Application\User\ReadModel;
15
16
final class User
17
{
18
    public string $uuid;
19
    public string $username;
20
    public string $email;
21
    public ?string $password;
22
    public array $roles;
23
24
    public function __construct(
25
        string $uuid,
26
        string $username,
27
        string $email,
28
        ?string $password = null,
29
        array $roles = []
30
    ) {
31
        $this->uuid = $uuid;
32
        $this->username = $username;
33
        $this->email = $email;
34
        $this->password = $password;
35
        $this->roles = $roles;
36
    }
37
38
    public function uuid(): ?string
39
    {
40
        return $this->uuid;
41
    }
42
43
    public function username(): string
44
    {
45
        return $this->username;
46
    }
47
48
    public function email(): string
49
    {
50
        return $this->email;
51
    }
52
53
    public function password(): ?string
54
    {
55
        return $this->password;
56
    }
57
58
    public function roles(): array
59
    {
60
        return $this->roles;
61
    }
62
}
63