Completed
Push — master ( 11795b...abede7 )
by Nathan
02:11
created

Amount   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 19
ccs 10
cts 10
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 6 2
1
<?php
2
3
namespace ZenCash\Rpc\Command\Wallet\ZSendMany;
4
5
final class Amount implements \JsonSerializable
6
{
7
    private $address;
8
    private $amount;
9
    private $memo;
10
11 3
    public function __construct(string $address, float $amount, ?string $memo)
12
    {
13 3
        $this->address = $address;
14 3
        $this->amount = $amount;
15 3
        $this->memo = $memo;
16 3
    }
17
18 2
    public function jsonSerialize(): object
19
    {
20 2
        return (object) array_merge([
21 2
            'address' => $this->address,
22 2
            'amount' => $this->amount
23 2
        ], !is_null($this->memo) ? [ 'memo' => $this->memo ] : [ ]);
24
    }
25
}
26