ListTransactions::__construct()   A
last analyzed

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 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