Cache::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
4
namespace Appino\Blockchain\Objects;
5
6
7
class Cache{
8
9
    public $receiveAccount;
10
    public $changeAccount;
11
12
    public function __construct($params){
13
        if(is_null($params))
14
            return;
15
        $this->receiveAccount = data_get($params,'receiveAccount');
16
        $this->changeAccount = data_get($params,'changeAccount');
17
    }
18
19
    public function __toString(){
20
        $class_vars = get_class_vars(get_class($this));
21
        $response = [];
22
        foreach ($class_vars as $key => $value){
23
            $response[$key] = $this->{$key};
24
        }
25
        return json_encode($response, JSON_THROW_ON_ERROR) ."";
26
    }
27
28
}
29