GetBalance   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A jsonSerialize() 0 7 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