Passed
Push — feat/manage-settings ( 66d990...95214d )
by
unknown
01:35
created

AbstractUser   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A password() 0 3 1
A uuid() 0 3 1
A roles() 0 3 1
A email() 0 3 1
A username() 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 User\Application\Command;
15
16
use Core\Domain\Protocol\Common\Command\CommandInterface;
17
18
abstract class AbstractUser implements CommandInterface
19
{
20
    public ?string $uuid;
21
    private string $username;
22
    private string $email;
23
    private string $password;
24
    private array $roles;
25
26
    public function __construct(
27
        string $username,
28
        string $email,
29
        string $password,
30
        array $roles = ['ROLE_USER'],
31
        ?string $uuid = null
32
    ) {
33
        $this->uuid = $uuid;
34
        $this->username = $username;
35
        $this->email = $email;
36
        $this->password = $password;
37
        $this->roles = $roles;
38
    }
39
40
    final public function uuid(): ?string
41
    {
42
        return $this->uuid;
43
    }
44
45
    final public function username(): string
46
    {
47
        return $this->username;
48
    }
49
50
    final public function email(): string
51
    {
52
        return $this->email;
53
    }
54
55
    final public function password(): string
56
    {
57
        return $this->password;
58
    }
59
60
    final public function roles(): array
61
    {
62
        return $this->roles;
63
    }
64
}
65