KeyConverter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 5
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A fromJWKtoPEM() 0 3 1
A fromJWKStoPEMS() 0 3 1
1
<?php
2
3
/**
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @see https://github.com/ecphp
8
 */
9
10
declare(strict_types=1);
11
12
namespace EcPhp\ApiGwAuthenticationBundle\Service\KeyConverter;
13
14
use CoderCat\JWKToPEM\JWKConverter;
15
16
final class KeyConverter implements KeyConverterInterface
17
{
18
    private JWKConverter $jwkConverter;
19
20 3
    public function __construct(JWKConverter $jwkConverter)
21
    {
22 3
        $this->jwkConverter = $jwkConverter;
23
    }
24
25 1
    public function fromJWKStoPEMS(array $jwks): array
26
    {
27 1
        return $this->jwkConverter->multipleToPEM($jwks);
28
    }
29
30 1
    public function fromJWKtoPEM(array $jwk): string
31
    {
32 1
        return $this->jwkConverter->toPEM($jwk);
33
    }
34
}
35