Completed
Push — feature/EVO-6305_worker_authen... ( 9fae6b )
by
unknown
10:18
created

SubnetUser::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * security SubnetUser entity
4
 * A basic user to allow login, query and find object based on anonymous authentication.
5
 */
6
7
namespace Graviton\SecurityBundle\Entities;
8
9
/**
10
 * Class SubnetUser
11
 *
12
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
13
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
14
 * @link     http://swisscom.ch
15
 */
16
class SubnetUser
17
{
18
    const DEFAULT_ID = 0;
19
20
    /**
21
     * @var int
22
     */
23
    private $id;
24
25
    /**
26
     * @var string
27
     */
28
    private $username;
29
30
    /**
31
     * Constructor of the class.
32
     *
33
     * @param string $username Name of the user
34
     */
35
    public function __construct($username)
36
    {
37
        $this->username = $username;
38
        $this->setId(self::DEFAULT_ID);
39
    }
40
41
    /**
42
     * Returns the username used to authenticate the user.
43
     *
44
     * @return string The username
45
     */
46
    public function getUsername()
47
    {
48
        return $this->username;
49
    }
50
51
    /**
52
     * @param int $id id
53
     * @return void
54
     */
55
    public function setId($id)
56
    {
57
        $this->id = $id;
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function getId()
64
    {
65
        return $this->id;
66
    }
67
}
68