UserEntity   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 104
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 11
c 3
b 0
f 1
lcom 0
cbo 0
dl 0
loc 104
rs 10
ccs 30
cts 30
cp 1

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A setRegistrationDate() 0 4 1
A getEmail() 0 4 1
A getUsername() 0 4 1
A getUserId() 0 4 1
A getPasswordHash() 0 4 1
A getRegistrationDate() 0 4 1
A getLastAction() 0 4 1
A setLastAction() 0 4 1
A setEmail() 0 4 1
A setPasswordHash() 0 4 1
1
<?php
2
3
namespace OpenTribes\Core\Entity;
4
5
6
use DateTime;
7
8
class UserEntity
9
{
10
    private $userId = 0;
11
    private $username = '';
12
    private $passwordHash = '';
13
    private $email = '';
14
    /**
15
     * @var DateTime
16
     */
17
    private $registrationDate = null;
18
    /**
19
     * @var DateTime
20
     */
21
    private $lastAction = null;
22 44
    public function __construct($userId, $username, $passwordHash, $email)
23
    {
24 44
        $this->userId = $userId;
25 44
        $this->username = $username;
26 44
        $this->passwordHash = $passwordHash;
27 44
        $this->email = $email;
28 44
    }
29
30
31
    /**
32
     * @param DateTime $registrationDate
33
     */
34 14
    public function setRegistrationDate(DateTime $registrationDate)
35
    {
36 14
        $this->registrationDate = $registrationDate;
37 14
    }
38
39
    /**
40
     * @return string
41
     */
42 32
    public function getEmail()
43
    {
44 32
        return $this->email;
45
    }
46
47
    /**
48
     * @return string
49
     */
50 44
    public function getUsername()
51
    {
52 44
        return $this->username;
53
    }
54
55
    /**
56
     * @return int
57
     */
58 43
    public function getUserId()
59
    {
60 43
        return $this->userId;
61
    }
62
63
    /**
64
     * @return string
65
     */
66 10
    public function getPasswordHash()
67
    {
68 10
        return $this->passwordHash;
69
    }
70
71
    /**
72
     * @return DateTime
73
     */
74 5
    public function getRegistrationDate()
75
    {
76 5
        return $this->registrationDate;
77
    }
78
79
    /**
80
     * @return DateTime
81
     */
82 5
    public function getLastAction()
83
    {
84 5
        return $this->lastAction;
85
    }
86
87
    /**
88
     * @param DateTime $lastAction
89
     */
90 5
    public function setLastAction(DateTime $lastAction)
91
    {
92 5
        $this->lastAction = $lastAction;
93 5
    }
94
95
    /**
96
     * @param string $email
97
     */
98 1
    public function setEmail($email)
99
    {
100 1
        $this->email = $email;
101 1
    }
102
103
    /**
104
     * @param string $passwordHash
105
     */
106 1
    public function setPasswordHash($passwordHash)
107
    {
108 1
        $this->passwordHash = $passwordHash;
109 1
    }
110
111
}