GetBalance::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
namespace ZenCash\Rpc\Command\Wallet;
4
5
use ZenCash\Rpc\Command;
6
7
final class GetBalance implements Command
8
{
9
    private const METHOD = 'getbalance';
10
    private $account = '*';
11
    private $minConf;
12
    private $includeWatchOnly;
13
14 3
    public function __construct(int $minConf = 1, bool $includeWatchOnly = false)
15
    {
16 3
        $this->minConf = $minConf;
17 3
        $this->includeWatchOnly = $includeWatchOnly;
18 3
    }
19
20 3
    public function jsonSerialize(): object
21
    {
22
        return (object) [
23 3
            'jsonrpc' => Command::JSON_RPC_VERSION,
24
            'id'      => Command::ID,
25 3
            'method'  => self::METHOD,
26 3
            'params' => [ $this->account, $this->minConf, $this->includeWatchOnly ]
27
        ];
28
    }
29
}
30