Passed
Branch main (00d2aa)
by Pouya
03:55 queued 01:48
created

PaymentResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 6
c 3
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
4
namespace Appino\Blockchain\Objects;
5
6
7
class PaymentResponse{
8
    /**
9
     * @var array of string
10
     */
11
    public $to;
12
    /**
13
     * @var array of string
14
     */
15
    public $from;
16
    /**
17
     * @var array of integer in satoshi
18
     */
19
    public $amount;
20
    /**
21
     * @var integer in satoshi
22
     */
23
    public $fee;
24
    /**
25
     * @var string
26
     */
27
    public $txid;
28
    /**
29
     * @var bool
30
     */
31
    public $success;
32
33
    /**
34
     * PaymentResponse constructor.
35
     * @param $json array
36
     */
37
38
    public function __construct($json){
39
        $this->to = data_get($json,'to');
40
        $this->from = data_get($json,'from');
41
        $this->amount = data_get($json,'amount');
42
        $this->fee = data_get($json,'fee');
43
        $this->txid = data_get($json,'txid');
44
        $this->success = data_get($json,'success');
45
    }
46
47
}
48