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