ListTransactions   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A jsonSerialize() 0 11 1
1
<?php
2
3
namespace ZenCash\Rpc\Command\Wallet;
4
5
use ZenCash\Rpc\Command;
6
7
final class ListTransactions implements Command
8
{
9
    private const METHOD = 'listtransactions';
10
    private $account = '*';
11
    private $count;
12
    private $from;
13
    private $includeWatchOnly;
14
15 2
    public function __construct(int $count = 10, int $from = 0, bool $includeWatchOnly = false)
16
    {
17 2
        $this->count = $count;
18 2
        $this->from = $from;
19 2
        $this->includeWatchOnly = $includeWatchOnly;
20 2
    }
21
22 2
    public function jsonSerialize(): object
23
    {
24
        return (object) [
25 2
            'jsonrpc' => Command::JSON_RPC_VERSION,
26
            'id'      => Command::ID,
27 2
            'method'  => self::METHOD,
28
            'params' => [
29 2
                $this->account,
30 2
                $this->count,
31 2
                $this->from,
32 2
                $this->includeWatchOnly
33
            ]
34
        ];
35
    }
36
}
37