Key   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 42
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSecret() 0 3 1
A getId() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Acquia\Hmac;
4
5
/**
6
 * A key for authenticating and signing requests.
7
 */
8
class Key implements KeyInterface
9
{
10
    /**
11
     * @var string
12
     *   The key ID.
13
     */
14
    protected $id;
15
16
    /**
17
     * @var string
18
     *   The key secret.
19
     */
20
    protected $secret;
21
22
    /**
23
     * Initializes the key with a key ID and key secret.
24
     *
25
     * @param string $id
26
     *   The key ID.
27
     * @param string $secret
28
     *   The Base64-encoded key secret.
29
     */
30 31
    public function __construct($id, $secret)
31
    {
32 31
        $this->id = $id;
33 31
        $this->secret = $secret;
34 31
    }
35
36
    /**
37
     * {@inheritDoc}
38
     */
39 19
    public function getId()
40
    {
41 19
        return $this->id;
42
    }
43
44
    /**
45
     * {@inheritDoc}
46
     */
47 24
    public function getSecret()
48
    {
49 24
        return $this->secret;
50
    }
51
}
52