Base64KeyLoader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 7 2
1
<?php
2
3
namespace Acquia\Hmac;
4
5
/**
6
 * Base64KeyLoader class for loading keys and Base64 encoding them.
7
 *
8
 * These keys can be later used for signing and verifying requests.
9
 */
10
class Base64KeyLoader extends KeyLoader
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15 2
    public function load($id)
16
    {
17 2
        if (!isset($this->keys[$id])) {
18 1
            return false;
19
        }
20
21 1
        return new Key($id, base64_encode($this->keys[$id]));
22
    }
23
}
24