Issues (12)

src/Command/Wallet/ZSendMany.php (1 issue)

Severity
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
The parameter $amounts 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 ignore-unused  annotation

24
        call_user_func_array(function(/** @scrutinizer ignore-unused */ Amount ...$amounts) {}, $amounts);

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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