KeyConverter::__construct()   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 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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