RemoteUser   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 63
c 0
b 0
f 0
wmc 5
lcom 0
cbo 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
getRoles() 0 1 ?
A getProfile() 0 4 1
A getPassword() 0 4 1
A getSalt() 0 4 1
A getUsername() 0 4 1
A eraseCredentials() 0 3 1
1
<?php
2
3
namespace Kaliop\IdentityManagementBundle\Security\User;
4
5
use Symfony\Component\Security\Core\User\UserInterface;
6
7
abstract class RemoteUser implements UserInterface
8
{
9
    protected $username;
10
    protected $password;
11
    /**
12
     * Most likely to be set at creation time, holds the data coming from the remote system.
13
     *
14
     * NB: the whole profile gets serialized in the session, as part of the Sf auth token. You should probably make sure
15
     * that it does not include a huge amount of useless data, by implementing the Serializable interface...
16
     *
17
     * @var mixed
18
     */
19
    protected $profile;
20
21
    abstract public function getRoles();
22
23
    public function getProfile()
24
    {
25
        return $this->profile;
26
    }
27
28
    /**
29
     * Returns the password used to authenticate the user.
30
     * @return string The password
31
     */
32
    public function getPassword()
33
    {
34
        return $this->password;
35
    }
36
37
    /**
38
     * Returns the salt that was originally used to encode the password.
39
     *
40
     * This can return null if the password was not encoded using a salt.
41
     *
42
     * @return string|null The salt
43
     */
44
    public function getSalt()
45
    {
46
        return null;
47
    }
48
49
    /**
50
     * Returns the username used to authenticate the user.
51
     *
52
     * @return string The username
53
     */
54
    public function getUsername()
55
    {
56
        return $this->username;
57
    }
58
59
60
    /**
61
     * Removes sensitive data from the user.
62
     *
63
     * This is important if, at any given point, sensitive information like
64
     * the plain-text password is stored on this object.
65
     */
66
    public function eraseCredentials()
67
    {
68
    }
69
}