| 1 | <?php |
||
| 2 | |||
| 3 | namespace ZenCash\Rpc\Command\Wallet; |
||
| 4 | |||
| 5 | use ZenCash\Rpc\Command; |
||
| 6 | use ZenCash\Rpc\Command\Wallet\ZSendMany\Amount; |
||
| 7 | |||
| 8 | final class ZSendMany implements Command |
||
| 9 | { |
||
| 10 | private const METHOD = 'z_sendmany'; |
||
| 11 | private $fromAddress; |
||
| 12 | private $amounts; |
||
| 13 | private $minConf; |
||
| 14 | private $fee; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param string $fromAddress |
||
| 18 | * @param Amount[] $amounts |
||
| 19 | * @param int $minConfig |
||
| 20 | * @param float $fee |
||
| 21 | */ |
||
| 22 | public function __construct(string $fromAddress, array $amounts, int $minConf = 1, float $fee = 0.0001) |
||
| 23 | { |
||
| 24 | call_user_func_array(function(Amount ...$amounts) {}, $amounts); |
||
|
0 ignored issues
–
show
|
|||
| 25 | |||
| 26 | 2 | $this->fromAddress = $fromAddress; |
|
| 27 | 2 | $this->amounts = $amounts; |
|
| 28 | 2 | $this->minConf = $minConf; |
|
| 29 | 2 | $this->fee = $fee; |
|
| 30 | 2 | } |
|
| 31 | |||
| 32 | 2 | public function jsonSerialize(): object |
|
| 33 | { |
||
| 34 | return (object) [ |
||
| 35 | 2 | 'jsonrpc' => Command::JSON_RPC_VERSION, |
|
| 36 | 'id' => Command::ID, |
||
| 37 | 2 | 'method' => self::METHOD, |
|
| 38 | 'params' => [ |
||
| 39 | 2 | $this->fromAddress, |
|
| 40 | 2 | $this->amounts, |
|
| 41 | 2 | $this->minConf, |
|
| 42 | 2 | $this->fee |
|
| 43 | ] |
||
| 44 | ]; |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.