Passed
Push — feature/VSVGVQ-20 ( 246439...e7fef2 )
by steven
03:25
created

User   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 102
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 7
dl 0
loc 102
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getPassword() 0 3 1
A getRole() 0 3 1
A getEmail() 0 3 1
A __construct() 0 14 1
A getLastName() 0 3 1
A getFirstName() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace VSV\GVQ_API\User\Models;
4
5
use Ramsey\Uuid\UuidInterface;
6
use VSV\GVQ_API\Common\ValueObjects\NotEmptyString;
7
use VSV\GVQ_API\User\ValueObjects\Email;
8
use VSV\GVQ_API\User\ValueObjects\Password;
9
use VSV\GVQ_API\User\ValueObjects\Role;
10
11
class User
12
{
13
    /**
14
     * @var UuidInterface
15
     */
16
    private $id;
17
18
    /**
19
     * @var Email
20
     */
21
    private $email;
22
23
    /**
24
     * @var Password
25
     */
26
    private $password;
27
28
    /**
29
     * @var NotEmptyString
30
     */
31
    private $lastName;
32
33
    /**
34
     * @var NotEmptyString
35
     */
36
    private $firstName;
37
38
    /**
39
     * @var Role
40
     */
41
    private $role;
42
43
    /**
44
     * @param UuidInterface $id
45
     * @param Email $email
46
     * @param Password $password
47
     * @param NotEmptyString $lastName
48
     * @param NotEmptyString $firstName
49
     * @param Role $role
50
     */
51
    public function __construct(
52
        UuidInterface $id,
53
        Email $email,
54
        Password $password,
55
        NotEmptyString $lastName,
56
        NotEmptyString $firstName,
57
        Role $role
58
    ) {
59
        $this->id = $id;
60
        $this->email = $email;
61
        $this->password = $password;
62
        $this->lastName = $lastName;
63
        $this->firstName = $firstName;
64
        $this->role = $role;
65
    }
66
67
    /**
68
     * @return UuidInterface
69
     */
70
    public function getId(): UuidInterface
71
    {
72
        return $this->id;
73
    }
74
75
    /**
76
     * @return Email
77
     */
78
    public function getEmail(): Email
79
    {
80
        return $this->email;
81
    }
82
83
    /**
84
     * @return Password
85
     */
86
    public function getPassword(): Password
87
    {
88
        return $this->password;
89
    }
90
91
    /**
92
     * @return NotEmptyString
93
     */
94
    public function getLastName(): NotEmptyString
95
    {
96
        return $this->lastName;
97
    }
98
99
    /**
100
     * @return NotEmptyString
101
     */
102
    public function getFirstName(): NotEmptyString
103
    {
104
        return $this->firstName;
105
    }
106
107
    /**
108
     * @return Role
109
     */
110
    public function getRole(): Role
111
    {
112
        return $this->role;
113
    }
114
}
115