JwtRsaKey::getInstance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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