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

ListReceivedByAddress::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
crap 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