Completed
Push — master ( 9a5cc4...561bc8 )
by Luís
12s
created

HmacBench::createKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Lcobucci\JWT\Hmac;
5
6
use Lcobucci\Jose\Parsing\Parser;
7
use Lcobucci\JWT\Signer\Key;
8
use Lcobucci\JWT\SignerBench;
9
10
abstract class HmacBench extends SignerBench
11
{
12
    private const ENCODED_KEY = 'hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg';
13
14
    protected function signingKey(): Key
15
    {
16
        return $this->createKey();
17
    }
18
19
    protected function verificationKey(): Key
20
    {
21
        return $this->createKey();
22
    }
23
24
    private function createKey(): Key
25
    {
26
        $decoder = new Parser();
27
28
        return new Key($decoder->base64UrlDecode(self::ENCODED_KEY));
29
    }
30
}
31