CredentialsAwareTrait   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 82
ccs 14
cts 14
cp 1
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setPassword() 0 3 1
A getPassword() 0 3 1
A setToken() 0 3 1
A setSubdomain() 0 3 1
A getSubdomain() 0 3 1
A getToken() 0 3 1
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 32
    final public function setSubdomain(string $subdomain)
44
    {
45 32
        $this->subdomain = $subdomain;
46 32
    }
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 32
    final public function setToken(string $token)
65
    {
66 32
        $this->token = $token;
67 32
    }
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