Completed
Push — master ( f92ba6...977127 )
by Nathan
02:25 queued 20s
created

PrioritiseTransaction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A jsonSerialize() 0 7 1
A __construct() 0 5 1
1
<?php
2
3
namespace ZenCash\Rpc\Command\Mining;
4
5
use ZenCash\Rpc\Command;
6
7
final class PrioritiseTransaction implements Command
8
{
9
    private const METHOD = 'prioritisetransaction';
10
    private $txid;
11
    private $priority;
12
    private $fee;
13
14
    public function __construct(string $txid, float $priority, int $fee)
15
    {
16
        $this->txid = $txid;
17
        $this->priority = $priority;
18
        $this->fee = $fee;
19
    }
20
21
    public function jsonSerialize(): object
22
    {
23
        return (object) [
24
            'jsonrpc' => Command::JSON_RPC_VERSION,
25
            'id'      => Command::ID,
26
            'method'  => self::METHOD,
27
            'params' => [$this->txid, $this->priority, $this->fee]
28
        ];
29
    }
30
}
31