Passed
Push — develop ( 37c69c...faa16c )
by Laurent
03:14 queued 37s
created

EditUser   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 uuid() 0 3 1
A roles() 0 3 1
A email() 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\Domain\User\Command;
15
16
use Administration\Domain\User\Model\VO\UserUuid;
17
use Core\Domain\Common\Model\VO\EmailField;
18
use Core\Domain\Common\Model\VO\NameField;
19
use Core\Domain\Protocol\Common\Command\CommandProtocol;
20
21
final class EditUser implements CommandProtocol
22
{
23
    private UserUuid $uuid;
24
    private NameField $username;
25
    private EmailField $email;
26
    private string $password;
27
    private array $roles;
28
29
    public function __construct(
30
        UserUuid $uuid,
31
        NameField $username,
32
        EmailField $email,
33
        string $password,
34
        array $roles = []
35
    ) {
36
        $this->uuid = $uuid;
37
        $this->username = $username;
38
        $this->email = $email;
39
        $this->password = $password;
40
        $this->roles = $roles;
41
    }
42
43
    public function uuid(): UserUuid
44
    {
45
        return $this->uuid;
46
    }
47
48
    public function username(): NameField
49
    {
50
        return $this->username;
51
    }
52
53
    public function email(): EmailField
54
    {
55
        return $this->email;
56
    }
57
58
    public function password(): string
59
    {
60
        return $this->password;
61
    }
62
63
    public function roles(): array
64
    {
65
        return $this->roles;
66
    }
67
}
68