Completed
Push — master ( efe7fa...260da8 )
by Guillermo A.
01:44
created

CredentialsAwareTrait::getPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Guillermoandrae\Highrise\Http;
4
5
trait CredentialsAwareTrait
6
{
7
    /**
8
     * The account subdomain.
9
     *
10
     * @var string
11
     */
12
    protected $subdomain;
13
14
    /**
15
     * The authentication token.
16
     *
17
     * @var string
18
     */
19
    protected $token;
20
21
    /**
22
     * The password to use for authentication.
23
     *
24
     * @var string
25
     */
26
    protected $password = 'X';
27
28
    /**
29
     * Returns the subdomain registered with this object.
30
     *
31
     * @return string
32
     */
33 3
    final public function getSubdomain(): string
34
    {
35 3
        return $this->subdomain;
36
    }
37
38
    /**
39
     * Registers the subdomain with this object.
40
     *
41
     * @param string $subdomain The subdomain.
42
     */
43 27
    final public function setSubdomain(string $subdomain)
44
    {
45 27
        $this->subdomain = $subdomain;
46 27
    }
47
48
    /**
49
     * Returns the token registered with this object.
50
     *
51
     * @return string
52
     */
53 3
    final public function getToken(): string
54
    {
55 3
        return $this->token;
56
    }
57
58
    /**
59
     * Registers the token with this object.
60
     *
61
     * @param string $token
62
     * @return null
63
     */
64 27
    final public function setToken(string $token)
65
    {
66 27
        $this->token = $token;
67 27
    }
68
69
    /**
70
     * Returns the password registered with this object.
71
     *
72
     * @return string
73
     */
74 2
    final public function getPassword(): string
75
    {
76 2
        return $this->password;
77
    }
78
79
    /**
80
     * Registers the password with this object.
81
     *
82
     * @param string $password  The password to use for authentication.
83
     */
84 1
    final public function setPassword(string $password): void
85
    {
86 1
        $this->password = $password;
87 1
    }
88
}
89