Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | 4 | public function setExchange($exchange) |
|
38 | { |
||
39 | 4 | if (is_array($exchange)) { |
|
40 | 2 | $exchange = new Exchange($exchange); |
|
41 | 2 | } |
|
42 | 4 | if (!$exchange instanceof Exchange) { |
|
43 | 1 | throw new \InvalidArgumentException( |
|
44 | 'Parameter "exchange" should be array or an instance of Exchange options' |
||
45 | 1 | ); |
|
46 | } |
||
47 | 3 | $this->exchange = $exchange; |
|
48 | |||
49 | 3 | return $this; |
|
50 | } |
||
51 | |||
72 |