1 | <?php |
||
2 | |||
3 | namespace ZenCash\Rpc\Command\Util; |
||
4 | |||
5 | use ZenCash\Rpc\Command; |
||
6 | |||
7 | final class CreateMultiSig implements Command |
||
8 | { |
||
9 | private const METHOD = 'createmultisig'; |
||
10 | private $nRequired; |
||
11 | private $keys; |
||
12 | |||
13 | /** |
||
14 | * CreateMultiSig constructor |
||
15 | * @param int $nRequired |
||
16 | * @param string[] $keys |
||
17 | */ |
||
18 | public function __construct(int $nRequired, array $keys) |
||
19 | { |
||
20 | call_user_func_array(function(string ...$keys) {}, $keys); |
||
0 ignored issues
–
show
|
|||
21 | |||
22 | 2 | if (empty($keys)) { |
|
23 | 1 | throw new \InvalidArgumentException('At least 1 key must be supplied.'); |
|
24 | } |
||
25 | |||
26 | 1 | $this->nRequired = $nRequired; |
|
27 | 1 | $this->keys = $keys; |
|
28 | 1 | } |
|
29 | |||
30 | 1 | public function jsonSerialize(): object |
|
31 | { |
||
32 | return (object) [ |
||
33 | 1 | 'jsonrpc' => Command::JSON_RPC_VERSION, |
|
34 | 'id' => Command::ID, |
||
35 | 1 | 'method' => self::METHOD, |
|
36 | 1 | 'params' => [ $this->nRequired, $this->keys ] |
|
37 | ]; |
||
38 | } |
||
39 | } |
||
40 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.