1 | <?php |
||||
2 | |||||
3 | namespace ZenCash\Rpc\Command\Wallet; |
||||
4 | |||||
5 | use ZenCash\Rpc\Command; |
||||
6 | use ZenCash\Rpc\Command\Wallet\SendMany\Amount; |
||||
7 | |||||
8 | final class SendMany implements Command |
||||
9 | { |
||||
10 | private const METHOD = 'sendmany'; |
||||
11 | private $account = ''; |
||||
12 | private $amounts; |
||||
13 | private $minConfig; |
||||
14 | private $comment; |
||||
15 | private $subtractFromAddresses; |
||||
16 | |||||
17 | /** |
||||
18 | * @param Amount[] $amounts |
||||
19 | * @param int $minConfig |
||||
20 | * @param string $comment |
||||
21 | * @param string[] $subtractFromAddresses |
||||
22 | */ |
||||
23 | public function __construct(array $amounts, int $minConfig = 1, string $comment = '', array $subtractFromAddresses = []) |
||||
24 | { |
||||
25 | call_user_func_array(function(Amount ...$amounts) {}, $amounts); |
||||
0 ignored issues
–
show
|
|||||
26 | call_user_func_array(function(string ...$addresses) {}, $subtractFromAddresses); |
||||
0 ignored issues
–
show
The parameter
$addresses is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||
27 | |||||
28 | 2 | $this->amounts = $amounts; |
|||
29 | 2 | $this->minConfig = $minConfig; |
|||
30 | 2 | $this->comment = $comment; |
|||
31 | 2 | $this->subtractFromAddresses = $subtractFromAddresses; |
|||
32 | 2 | } |
|||
33 | |||||
34 | 2 | public function jsonSerialize(): object |
|||
35 | { |
||||
36 | return (object) [ |
||||
37 | 2 | 'jsonrpc' => Command::JSON_RPC_VERSION, |
|||
38 | 'id' => Command::ID, |
||||
39 | 2 | 'method' => self::METHOD, |
|||
40 | 'params' => [ |
||||
41 | 2 | $this->account, |
|||
42 | 2 | $this->amounts, |
|||
43 | 2 | $this->minConfig, |
|||
44 | 2 | $this->comment, |
|||
45 | 2 | $this->subtractFromAddresses |
|||
46 | ] |
||||
47 | ]; |
||||
48 | } |
||||
49 | } |
||||
50 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.