JwtRsaKey   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 9
c 1
b 0
f 0
dl 0
loc 39
ccs 11
cts 11
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getPublicKey() 0 3 1
A getPrivateKey() 0 3 1
A __construct() 0 4 1
A getAlghoritm() 0 3 1
A getInstance() 0 3 1
1
<?php
2
3
namespace ByJG\Util;
4
5
class JwtRsaKey implements JwtKeyInterface
6
{
7
    protected $private;
8
    protected $public;
9
10
    /**
11
     * JwtRsaKey constructor.
12
     * @param $private
13
     * @param $public
14
     */
15 9
    public function __construct($private, $public)
16
    {
17 9
        $this->private = $private;
18 9
        $this->public = $public;
19
    }
20
21
    /**
22
     * @param $private
23
     * @param $public
24
     * @return JwtRsaKey
25
     */
26 1
    public static function getInstance($private, $public)
27
    {
28 1
        return new JwtRsaKey($private, $public);
29
    }
30
31 8
    public function getPublicKey()
32
    {
33 8
        return $this->public;
34
    }
35
36 6
    public function getPrivateKey()
37
    {
38 6
        return $this->private;
39
    }
40
41 8
    public function getAlghoritm()
42
    {
43 8
        return 'RS512';
44
    }
45
}
46