Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
16 | 3 | public function call( |
|
17 | Session $session, |
||
18 | CurrentPinInputInterface $currentPinInput, |
||
19 | GetPublicKey $getPublicKey |
||
20 | ): PublicKey { |
||
21 | 3 | $proto = $session->sendMessage(Message::getPublicKey($getPublicKey)); |
|
22 | 3 | if ($proto instanceof PinMatrixRequest) { |
|
23 | 1 | $proto = $session->sendMessage($this->provideCurrentPin($proto, $currentPinInput)); |
|
24 | } |
||
25 | |||
26 | 3 | if (!($proto instanceof PublicKey)) { |
|
27 | 1 | throw new \RuntimeException("Unexpected response, expecting PublicKey, got " . get_class($proto)); |
|
28 | } |
||
29 | |||
30 | 2 | return $proto; |
|
31 | } |
||
33 |