Passed
Push — master ( 60a7f4...842697 )
by Nathan
03:00
created

AddMultiSigAddress   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 25
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A jsonSerialize() 0 7 1
A __construct() 0 6 1
1
<?php
2
3
namespace ZenCash\Rpc\Command\Wallet;
4
5
use ZenCash\Rpc\Command;
6
7
final class AddMultiSigAddress implements Command
8
{
9
    private const METHOD = 'addmultisigaddress';
10
    private $nRequired;
11
    private $keys;
12
13
    /**
14
     * @param int $nRequired
15
     * @param string[] $keys
16
     */
17
    public function __construct(int $nRequired, array $keys)
18
    {
19
        call_user_func_array(function(string $key) {}, $keys);
0 ignored issues
show
Unused Code introduced by
The parameter $key 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

19
        call_user_func_array(function(/** @scrutinizer ignore-unused */ string $key) {}, $keys);

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...
20
21 1
        $this->nRequired = $nRequired;
22 1
        $this->keys = $keys;
23 1
    }
24
25 1
    public function jsonSerialize(): object
26
    {
27
        return (object) [
28 1
            'jsonrpc' => Command::JSON_RPC_VERSION,
29
            'id'      => Command::ID,
30 1
            'method'  => self::METHOD,
31 1
            'params' => [ $this->nRequired, $this->keys ]
32
        ];
33
    }
34
}
35