Base64KeyLoader::load()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
c 1
b 0
f 0
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