Cache   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 19
rs 10
c 1
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
A __toString() 0 7 2
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