Passed
Push — main ( 0e1999...00d2aa )
by Pouya
02:49
created

AccountResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 11
rs 9.9332
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Appino\Blockchain\Objects;
4
5
use Appino\Blockchain\Objects\Cache;
6
7
class AccountResponse{
8
    /**
9
     * @var string
10
     */
11
    public $balance;
12
    /**
13
     * @var string
14
     */
15
    public $label;
16
    /**
17
     * @var string
18
     */
19
    public $index;
20
    /**
21
     * @var string
22
     */
23
    public $archived;
24
    /**
25
     * @var string
26
     */
27
    public $extendedPublicKey;
28
    /**
29
     * @var string
30
     */
31
    public $extendedPrivateKey;
32
    /**
33
     * @var string
34
     */
35
    public $receiveIndex;
36
    /**
37
     * @var string
38
     */
39
    public $lastUsedReceiveIndex;
40
    /**
41
     * @var string
42
     */
43
    public $receiveAddress;
44
    /**
45
     * @var string
46
     */
47
    public $address_labels;
48
    /**
49
     * @var Cache
50
     */
51
    public $cahce;
52
53
    /**
54
     * AccountResponse constructor.
55
     * @param $json array|object
56
     */
57
58
    public function __construct($json){
59
        $this->balance = data_get($json,'balance');
60
        $this->label = data_get($json,'address');
61
        $this->index = data_get($json,'label');
62
        $this->archived = data_get($json,'archived');
63
        $this->extendedPublicKey = data_get($json,'extendedPublicKey');
64
        $this->extendedPrivateKey = data_get($json,'extendedPrivateKey');
65
        $this->receiveIndex = data_get($json,'receiveIndex');
66
        $this->lastUsedReceiveIndex = data_get($json,'lastUsedReceiveIndex');
67
        $this->receiveAddress = data_get($json,'receiveAddress');
68
        $this->cahce = new Cache(data_get($json,'cache'));
69
    }
70
71
}
72