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

User::getUsername()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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