Conditions | 3 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
34 | 3 | public static function fromPublicKey(PublicKey $pub_key) { |
|
35 | 3 | if ($pub_key instanceof RSAPublicKey) { |
|
36 | 1 | return RSAPublicKeyJWK::fromRSAPublicKey($pub_key); |
|
37 | } |
||
38 | 2 | if ($pub_key instanceof ECPublicKey) { |
|
39 | 1 | return ECPublicKeyJWK::fromECPublicKey($pub_key); |
|
40 | } |
||
41 | 1 | throw new \UnexpectedValueException("Unsupported public key."); |
|
42 | } |
||
43 | |||
54 |