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 |
||
41 | 3 | public static function fromPrivateKey(PrivateKey $priv_key) { |
|
42 | 3 | if ($priv_key instanceof RSAPrivateKey) { |
|
43 | 1 | return RSAPrivateKeyJWK::fromRSAPrivateKey($priv_key); |
|
44 | } |
||
45 | 2 | if ($priv_key instanceof ECPrivateKey) { |
|
46 | 1 | return ECPrivateKeyJWK::fromECPrivateKey($priv_key); |
|
47 | } |
||
48 | 1 | throw new \UnexpectedValueException("Unsupported private key."); |
|
49 | } |
||
50 | |||
61 |