User   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 7
c 2
b 0
f 2
lcom 0
cbo 0
dl 0
loc 78
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getId() 0 3 1
A getUsername() 0 3 1
A getPassword() 0 3 1
A getSalt() 0 3 1
A getRoles() 0 3 1
A eraseCredentials() 0 3 1
1
<?php
2
3
namespace Developtech\AgilityBundle\Tests\Mock;
4
5
use Symfony\Component\Security\Core\User\UserInterface;
6
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * @ORM\Entity()
11
 */
12
class User implements UserInterface {
13
    /**
14
     * @var integer
15
     *
16
     * @ORM\Id
17
     * @ORM\GeneratedValue(strategy="AUTO")
18
     * @ORM\Column(type="integer")
19
     **/
20
    protected $id;
21
22
    /**
23
     * @var string
24
     *
25
     * @ORM\Column(type="string", length=65)
26
     **/
27
    protected $username;
28
    /** @var string **/
29
    protected $password;
30
    /** @var string **/
31
    protected $salt;
32
    /** @var array **/
33
    protected $roles;
34
35
    /**
36
     * @param string $username
37
     * @param string $password
38
     * @param string $salt
39
     * @param array $roles
40
     */
41
    public function __construct($username = '', $password = '', $salt = '', $roles = []) {
42
        $this->username = $username;
43
        $this->password = $password;
44
        $this->salt = $salt;
45
        $this->roles = $roles;
46
    }
47
48
    /**
49
     * @return int
50
     */
51
    public function getId() {
52
        return $this->id;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getUsername() {
59
        return $this->username;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getPassword() {
66
        return $this->password;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getSalt() {
73
        return $this->salt;
74
    }
75
76
    /**
77
     * @return array
78
     */
79
    public function getRoles() {
80
        return $this->roles;
81
    }
82
83
    /**
84
     * @return boolean
85
     */
86
    public function eraseCredentials() {
87
        return true;
88
    }
89
}
90