Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
17 | 2 | public function call( |
|
18 | Session $session, |
||
19 | GetEntropy $getEntropy |
||
20 | ): Entropy { |
||
21 | |||
22 | 2 | $proto = $session->sendMessage(Message::getEntropy($getEntropy)); |
|
23 | 2 | if ($proto instanceof ButtonRequest) { |
|
24 | 1 | $proto = $session->sendMessage($this->confirmWithButton($proto, ButtonRequestType::ButtonRequest_ProtectCall())); |
|
25 | } |
||
26 | |||
27 | 2 | if (!($proto instanceof Entropy)) { |
|
28 | 1 | throw new UnexpectedResultException("Unexpected message returned, expecting Entropy"); |
|
29 | } |
||
30 | |||
31 | 1 | return $proto; |
|
32 | } |
||
34 |