Conditions | 3 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
30 | public function addItem(object $item) : JsonRpcRawRequest |
||
31 | { |
||
32 | if (!$item instanceof JsonRpcResponse && !$item instanceof \Exception) { |
||
33 | throw new \InvalidArgumentException( |
||
34 | sprintf( |
||
35 | 'item must be either an instance of %s or an instance of %s', |
||
36 | JsonRpcRequest::class, |
||
37 | \Exception::class |
||
38 | ) |
||
39 | ); |
||
40 | } |
||
41 | |||
42 | $this->itemList[] = $item; |
||
43 | |||
44 | return $this; |
||
45 | } |
||
63 |