Passed
Push — master ( 66c18a...043c10 )
by Pol
22:47 queued 20:11
created

KeyConverter::fromJWKStoPEMS()   A

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
8
declare(strict_types=1);
9
10
namespace EcPhp\ApiGwAuthenticationBundle\Service\KeyConverter;
11
12
use CoderCat\JWKToPEM\JWKConverter;
13
14
final class KeyConverter implements KeyConverterInterface
15
{
16
    private JWKConverter $jwkConverter;
17
18 3
    public function __construct(JWKConverter $jwkConverter)
19
    {
20 3
        $this->jwkConverter = $jwkConverter;
21 3
    }
22
23 1
    public function fromJWKStoPEMS(array $jwks): array
24
    {
25 1
        return $this->jwkConverter->multipleToPEM($jwks);
26
    }
27
28 1
    public function fromJWKtoPEM(array $jwk): string
29
    {
30 1
        return $this->jwkConverter->toPEM($jwk);
31
    }
32
}
33