Completed
Push — master ( 2e9864...458655 )
by Nathan
02:14
created

ListReceivedByAddress   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 21
ccs 9
cts 9
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 5 1
1
<?php
2
3
namespace ZenCash\Rpc\Command\Wallet;
4
5
use ZenCash\Rpc\Command;
6
7
final class ListReceivedByAddress implements Command
8
{
9
    private const METHOD = 'listreceivedbyaddress';
10
    private $minConf;
11
    private $includeEmpty;
12
    private $includeWatchOnly;
13
14 4
    public function __construct(int $minConf = 1, bool $includeEmpty = false, bool $includeWatchOnly = false)
15
    {
16 4
        $this->minConf = $minConf;
17 4
        $this->includeEmpty = $includeEmpty;
18 4
        $this->includeWatchOnly = $includeWatchOnly;
19 4
    }
20
21 4
    public function jsonSerialize(): object
22
    {
23
        return (object) [
24 4
            'jsonrpc' => Command::JSON_RPC_VERSION,
25
            'id'      => Command::ID,
26 4
            'method'  => self::METHOD,
27 4
            'params' => [ $this->minConf, $this->includeEmpty, $this->includeWatchOnly ]
28
        ];
29
    }
30
}
31