Signature   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 17
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSignature() 0 4 1
A __construct() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace PeeHaa\AsyncTwitter\Oauth\Signature;
4
5
class Signature
6
{
7
    private $baseString;
8
9
    private $key;
10
11 6
    public function __construct(BaseString $baseString, Key $key)
12
    {
13 6
        $this->baseString = $baseString->getString();
14 6
        $this->key        = $key->getKey();
15
    }
16
17 6
    public function getSignature(): string
18
    {
19 6
        return rawurlencode(base64_encode(hash_hmac('sha1', $this->baseString, $this->key, true)));
20
    }
21
}
22