Completed
Push — master ( 3402a7...8f86ae )
by Wouter
02:13
created

User   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 8
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 79
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getRoles() 0 4 1
A getPassword() 0 4 1
A getSalt() 0 4 1
A getUsername() 0 4 1
A eraseCredentials() 0 4 1
A getDisplayName() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace SumoCoders\FrameworkMultiUserBundle\User;
4
5
class User implements UserInterface
6
{
7
    /** @var string */
8
    private $username;
9
10
    /** @var string */
11
    private $password;
12
13
    /** @var string */
14
    private $displayName;
15
16
    /**
17
     * @param string $username
18
     * @param string $password
19
     * @param string $displayName
20
     */
21
    public function __construct($username, $password, $displayName)
22
    {
23
        $this->username = $username;
24
        $this->password = $password;
25
        $this->displayName = $displayName;
26
    }
27
28
    /**
29
     * {@inheritDoc}
30
     */
31
    public function getRoles()
32
    {
33
        return [ 'ROLE_USER' ];
34
    }
35
36
    /**
37
     * {@inheritDoc}
38
     */
39
    public function getPassword()
40
    {
41
        return $this->password;
42
    }
43
44
    /**
45
     * {@inheritDoc}
46
     */
47
    public function getSalt()
48
    {
49
        return;
50
    }
51
52
    /**
53
     * {@inheritDoc}
54
     */
55
    public function getUsername()
56
    {
57
        return $this->username;
58
    }
59
60
    /**
61
     * {@inheritDoc}
62
     */
63
    public function eraseCredentials()
64
    {
65
        return;
66
    }
67
68
    /**
69
     * {@inheritDoc}
70
     */
71
    public function getDisplayName()
72
    {
73
        return $this->displayName;
74
    }
75
76
    /**
77
     * {@inheritDoc}
78
     */
79
    public function __toString()
80
    {
81
        return $this->getDisplayName();
82
    }
83
}
84