Completed
Pull Request — master (#3)
by Márk
02:31
created

UserPasswordPair::getUsername()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Http\Message\Authentication;
4
5
/**
6
 * Trait implementing the common username-password pattern.
7
 *
8
 * @author Márk Sági-Kazár <[email protected]>
9
 */
10
trait UserPasswordPair
11
{
12
    /**
13
     * @var string
14
     */
15
    private $username;
16
17
    /**
18
     * @var string
19
     */
20
    private $password;
21
22
    /**
23
     * Returns the username.
24
     *
25
     * @return string
26
     */
27 4
    public function getUsername()
28
    {
29 4
        return $this->username;
30
    }
31
32
    /**
33
     * Sets the username.
34
     *
35
     * @param string $username
36
     */
37 2
    public function setUsername($username)
38
    {
39 2
        $this->username = $username;
40 2
    }
41
42
    /**
43
     * Returns the password.
44
     *
45
     * @return string
46
     */
47 4
    public function getPassword()
48
    {
49 4
        return $this->password;
50
    }
51
52
    /**
53
     * Sets the password.
54
     *
55
     * @param string $password
56
     */
57 2
    public function setPassword($password)
58
    {
59 2
        $this->password = $password;
60 2
    }
61
}
62