Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
52 | public function fromArray(array $json) |
||
53 | { |
||
54 | if (array_key_exists('amount', $json) && array_key_exists('currency', $json)) { |
||
55 | $this->amount = $json['amount']; |
||
56 | $this->currency = $json['currency']; |
||
57 | |||
58 | return $this; |
||
59 | } |
||
60 | |||
61 | throw new \InvalidArgumentException('amount and currency are required to sign a transaction'); |
||
62 | } |
||
64 |